I've got C++ based static library that is built as a cmake project.
by itself it's compiled properly, but when being linked with another executable, many missing symbols shows up, which were supposedly be existed in that library because they all belong to another libraries that linked to it (2nd order libraries).
I've lookup for this issue over the web, and found out that the following flag may help me to avoid this memory size improvement and keep the missing symbols -Wl,--whole-archive
.
So from the static library cmake file, every time i linked against another library I use the following command :
target_link_libraries(myStaticLib PUBLIC
-Wl,--whole-archive
Boost::system Boost::thread Boost::coroutine
-Wl,--no-whole-archive
)
I Would have expected that all symbols from those linked sources will be inserted to the target library (myStaticLib)
However, i still see the same symbol appeared as missing.
Undefined symbols for architecture x86_64:
"boost::coroutines::stack_traits::default_size()", referenced from:
boost::coroutines::attributes::attributes() in myStaticLib.a(myFile1.o)
boost::coroutines::attributes::attributes() in myStaticLib.a(myFile2.o)
Any idea how to resolve it ?