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