[Solved] Undefine reference of


The problem is that

c++ test.cpp -I./include-core/ -o bin/test -L./bin -l${core_NAME_ROOT}c++ test.cpp -I./include-core/ -o bin/test -L./bin -l${core_NAME_ROOT}

will first process the library and then your .cpp file. When processing a library, referenced symbols are resolved (“linked”) and all unresolved symbols in the library that aren’t needed are thrown away. That means that as soon as your .cpp file is being processed, these symbols are already rejected. You have the library twice in your command line, but the second one is being ignored since the library was already processed.

You should always put the libraries (once) at the end of the compiler command line:

c++ test.cpp -I./include-core/ -o bin/test test.cpp -L./bin -l${core_NAME_ROOT}

2

solved Undefine reference of