Problem opening file

Sysprogs forums Forums VisualGDB Problem opening file

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10182
    manni
    Participant

    Hello,

    My Setup:

    Windows MS Visual Studio

    Crosscompile Linux Projekt on Raspberry Pi, MS Build.

    My project compiles ok.

    In cpp source code I want to open a file:

    For testing I use a simple text file.

    But the same problem with other file types.

    FILE *fp =  fopen(“test.txt”, “r”);
    if (!fp)
    {
    perror(“Error”);
    return 0;
    }

    The problem:

    When debugging, I can not open file because I get error: No such file.

    I added the test.txt file to the Project resource folder. Is that correct?

    With adding

    system(“pwd”);

    I got the path, and I added path to fopen() function:

    FILE *fp =  fopen(“/tmp/VisualGDB/c/Users/manni/Desktop/VisualGDBProjects/gles5/VisualGDB/Debug/test.txt”, “r”);
    if (!fp)
    {
    perror(“Error”);
    return 0;
    }

    Still same Problem:

    No such file:

    Question: Where do I have to copy the file, that I want to open (test.txt)?

     

    Thank you

     

    Manni

    #10183
    support
    Keymaster

    Hi,

    If you want to upload a text file to the target before debugging, you can add a new upload action to the custom pre-debug actions on the Debug Customization page of VisualGDB Project Properties (requires Custom edition or higher).

    #10184
    manni
    Participant

    Thanks for the quick answer,

    after the trial period I paid for the product, but In the VisualGDB project properties I don’t see the option Custom debug steps.

    How do I get the Custom edition?

     

    #10185
    support
    Keymaster

    Hi,

    You may have purchased the Linux edition then. You can always upgrade it here: https://sysprogs.com/splm/mykey

    Also if you don’t need to copy this file each time, you can simply upload it once with SmarTTY and keep on using the Linux edition.

    #10186
    manni
    Participant

    Yes, it’s working.Problem solved.

    I upgrade anyway.

    Thank you very much.

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