VisualGDB settings for reading text file in C program

Sysprogs forums Forums VisualGDB VisualGDB settings for reading text file in C program

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32336
    chintanp
    Participant

    Hi,

    I recently started using VisualGDB for Linux applications. I have code in my Windows PC and am trying to run it on WSL2 in my same machine. I had a couple of questions regarding the same:

     

    1. What is the recommended way to add folders with source and header files to the project/solution?

    2. How do I refer to a text file? See the attached project as an example. I have tried putting the files in the project folder and using a relative path in code, though I get a seg fault.

     

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #32338
    chintanp
    Participant

    Further:

    This method (https://stackoverflow.com/a/14962114/1328232) will not work for me as I want the file referencing method to be portable. So if I move my code directory to another Linux machine, then the code should work as is.

    I used the “Linux Project Wizard” to create a new project and used all the default settings and during the “Linux computer selection” step – chose WSL and all the tests done by VisualGDB were successful.

    Thanks

    #32357
    support
    Keymaster

    Hi,

    Please find the answers to your questions below:

    1. VisualGDB reuses the regular Visual Studio GUI for adding sources/headers to projects. If you are new to Visual Studio, please consider following a few generic Visual Studio tutorials first in order to get familiar with the basics. Our tutorials indeed focus on the functionality introduced by VisualGDB, and assume basic knowledge of common Visual Studio features.
    2. VisualGDB does not change the way the program would read text files. If your program is crashing with a seg fault, it likely does something incorrectly. If you suspect that the issue is introduced by VisualGDB, please consider debugging the program manually via gdb. If you can confirm that it works when launched manually and doesn’t work with VisualGDB, we can help you configure VisualGDB to replicate the manual debugging results.

     

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.