Linking Boost Library in Linux

前端 未结 3 1893
陌清茗
陌清茗 2020-12-28 13:09

I am trying to build a project using Boost\'s Asio and I am having some trouble. Initially, I tried to build the project without any additional libraries since everything i

相关标签:
3条回答
  • 2020-12-28 13:53

    Change -llibboost_system to -lboost_system.

    In linux, the "lib" prefix in front of a library is not used when referencing said library.

    0 讨论(0)
  • 2020-12-28 13:56

    In this case james' answer was correct, but if anybody else happens to stumble upon this post like I did then be aware that you can get this message if you link old boost headers against newer libraries. get_system_category() specifically has been deprecated. I ran into this problem while accidentally including distro-provided headers but linking against my own internal copy of boost.

    0 讨论(0)
  • 2020-12-28 14:04

    If you still get problems you might want to include posix-threads by adding to the linker flags:

    -lpthread
    
    0 讨论(0)
提交回复
热议问题