On 09/29/2010 06:25 PM, David Aldrich wrote:
> Hi
> 
> My C++ code consists of an executable and several shared libraries.
> 
> With my CMake build files, I find that the executable fails to load the 
> shared libraries ( the dlopen() call results in error 'undefined symbol...' ).
> 
> The software works fine under our production build system that uses manually 
> coded makefiles.
> 
> I notice that the production system linker command invokes -fpic, while CMake 
> uses -fPIC. I am wondering if that is the reason.
> 
> I set the compile flags with:
> 
> set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wall -m64" )
> 
> How can I replace -fPIC with -fpic in CMake please?

STRING(REGEX REPLACE "-fPIC" "-fpic" CMAKE_SHARED_LIBRARY_CXX_FLAGS
${CMAKE_SHARED_LIBRARY_CXX_FLAGS})

Is this option the only difference of the link commands? Do the compile
commands differ, too? Are there any options in the compile commands
which should also be present in the link commands but are missing?

Regards,

Michael
_______________________________________________
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

Reply via email to