CMake to link against non numbered libraries -


how can instruct cmake link against non-numbered version of library? instance when using boost libraries have:

find_package(boost components regex program_options required) target_link_libraries(main ${boost_program_options_library}) 

and executable links against libboost_program_options.so.1.49.0 . if try run executable in older machine fail because library can't found although know functionality present in library version.

that doesn't work. though functionality there, exact api may not there. that's why unix linking system uses symlinks, linker accesses unnumbered symlink, dereferences when writing out list of dependencies, require same major version @ runtime.

you have 3 choices:

  1. recompile on target machine older boost.
  2. distribute necessary boost library along executable. involves writing launch script sets ld_library_path before running.
  3. link against static boost libraries eliminate runtime dependency. use line before find_package:

set(boost_use_static_libs on)


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -