I have a.cpp and a.h files in separate from the main project directory. I include a.h header file into main project using absolute path. Hot to tell c++ where it must look for a.cpp file?
I have a.cpp and a.h files in separate from the main project directory. I
Share
The best way is to just add the
cppfile to the project.If it’s outside the project or excluded from the build, you could include it in a another source file (
#include "othercpp.cpp") and specify its path in the additional include directories under project settings.But the correct approach would be to add it to the project. It doesn’t have to be in the same place as other
cppfiles for this.