0

I need to link boost library as link library to my project... Build system is cmake v I do something so:

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON) 

include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

target_link_libraries(
    boost_system
    boost_regex
)

Build project was build successfull, but ldd print, that my binaries need libboost_system.so.1.62.0, libboost_regex.so.1.62.0(for example)...

libboost_system.so.1.62.0 => not found,
libboost_regex.so.1.62.0 => not found

What was wrong? Why this libraries are required if we wnat link statically?(sorry for my english)

xperious
  • 239
  • 3
  • 10
  • Between `set()` and `include_directories()` it should be `find_package(Boost)`, am I right? `but ldd print, that my binaries need libboost_system.so.1.62.0 ...` - I *guess*, `ldd` prints that corresponded libraries are not found? Please, add **exact error message** to your post. – Tsyvarev May 21 '18 at 13:53
  • @Tsyvarev, libboost_system.so.1.62.0 => not found libboost_regex.so.1.62.0 => not found – xperious May 21 '18 at 14:00

1 Answers1

0

I just add

target_link_libraries(
    libboost_system.a
    libboost_regex.a
)

It's was enough

xperious
  • 239
  • 3
  • 10