If I have a directory structure such as the tree below, what should my g++ command look like that would successfully compile the .cpp file that is in the taglib/bin dir, with all my .h files sitting in the taglib/include/taglib directory.
Anyones help would be greatly appreciated.
Thank you!
-taglib
--bin
.cpp file is here, incl headers are like this: #include <other.h>
but wondering if it should be #include </taglib/include/taglib/other.h>,
also, this should be where my binary will live when compiled.
--lib
all my .so files live here
--include
---taglib
all my .h files live here
The
-Iand-Loptions specify search directories for includes and libraries respectively. Therefore, you command should be something like:g++ -o <xyz> taglib/bin/*.cpp -Iinclude/taglib -Llibman gccand evengcc --helpgives great information on these particular command line options (and the GCC manual is fairly friendly too). You should really be trying them first before you ask here – it’s more efficient (no waiting for answers!).