Let’s say that I want to add common CPP files to multiple projects. I thought -L
would do it, but it does not seem to work.
In this example, I put the common.h and common.cpp to the Common directory and set
“-ICommon -LCommon” to the build flags. It seems that it got the header file, but it shows linkage error: undefined reference to
testFunction()’`
What is the -L
for, not for CPP files but only actual libraries? If so, is there any way to add a directory for common CPP files that is outside of the “src” directory? If there is no way, please let me know that.