Hi Michael
> You never link static libraries. They are more like zip files than actual
> libraries and just contain the compiled object files and for if you ran
> ranlib on it, also a "table-of-contents" to speed link up.
>
> If you do "target_link_libraries" in CMake, where the target is a static
> library, CMake just creates the static library archive and remembers
> internally the transitive link dependency. If you linked that static
> archive into an executable, the python libraries would then show up on the
> command line.
Now I am confused (more than before!) because linking my Kernel library does
give errors related to Python:
Linking CXX executable main
CMakeFiles/main.dir/Kernel.cpp.o: In function
`__static_initialization_and_destruction_0(int, int)':
Kernel.cpp:(.text+0x101): undefined reference to `_Py_NoneStruct'
Kernel.cpp:(.text+0x10d): undefined reference to `_Py_NoneStruct'
The make file is evidently building an executable even though I have only
specified:
add_library( Kernel STATIC ${SRCS} )
I can see from make VERBOSE=1, that it is trying to link main.exe instead of
calling 'ar' to build libKernel.a.
Can you give me some more help on this please?
David
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake