I have a project that has more makefiles. At some specific folders, there are some makefiles that can create binaries/executables. I right-click on the makefile and do a
Make Tarkgets -> Build -> all
Debug as -> Local C/C++ Application
FILE *f = fopen(fName, "rb"); // fname is a relative path : ../../../path/to/file
if(f == NULL)
I guess work directory is different for both cases, and thats why you can not open your file. Try to use absolute path for
fopen() or look for a way to specify proper work directory for the second case.
There is a way to modify the working directory, as mentioned in this answer:
Debug As -> Debug Configuration ...
Argumentstab, in the bottom, there is a
Working directory:area, uncheck the
Use defaultand add the correct path (where is the executable/binary). The buttons
File System...may help