Compile with boost to use whatever boost version is available?

前端 未结 1 759
孤城傲影
孤城傲影 2021-01-25 13:12

I\'ve compiled a Linux package on ubuntu 12.04 which uses boost and on this system i have boost 1.46. I tried to run the compiled release on another system and it complains that

相关标签:
1条回答
  • 2021-01-25 13:38

    You cannot expect your program to work with a different version of the library.

    The fact that there are /different/ versions implies that they're /not the same/.

    As mentioned, either

    • statically link to your specific version, or
    • you can ship the shared libraries (as long as you put them in a app-specific location and make sure you find them at runtime). Incidentally, see the second example here: How to compile boost async_client.cpp for the relevant linker options to use a custom library (it assumes the same location is to be used at runtime (rpath)
    0 讨论(0)
提交回复
热议问题