Hello *,<div><br></div><div>I have some library available as a Linux lib file. Now I need to create a shared object (actually a MODULE in terms of CMake) out of this lib. The module is later on loaded using the dlopen-API function.</div>
<div><br></div><div>I created a sample project with</div><div><br></div><div>/</div><div>+-- testlib</div><div>+-- so</div><div><br></div><div><br></div><div>testlib - consists of a single cpp file haveing a global variable and a function returning it.</div>
<div><br></div><div>CMake script:</div><div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)</div><div><br></div><div>PROJECT(testlib CXX)</div><div><br></div><div>add_library(testlib STATIC functions.cpp)</div></div><div><br></div>
<div><br></div><div>so - consists of a cpp file and links against testlib.</div><div><br></div><div>CMake script:</div><div><div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)</div><div><br></div><div>PROJECT(so CXX)</div><div>
<br></div><div>add_library(so MODULE main.cpp)</div><div>target_link_libraries(so testlib)</div><div>set_target_properties (so PROPERTIES VERSION 1.0 LINKER_LANGUAGE CXX)</div></div></div><div><br></div><div>and the Root CMakeLists.txt which should build both:</div>
<div><br></div><div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)</div><div><br></div><div>PROJECT(dll_test CXX)</div><div><br></div><div>add_subdirectory(lib)</div><div>add_subdirectory(so)</div><div>add_dependencies(so lib)</div>
</div><div><br></div><div><br></div><div>Now my problem is that after the build I can find the symbols from functions.cpp in the lib file using the nm tool. But these symbols are not part of the so. How can I force them to be part of the so-Module?</div>
<div><br></div><div><br></div><div>Thanks in advance,</div><div>Ovanes</div><div><br></div>