Adding Boost Library to a C++ project in OS X Eclipse

前端 未结 5 627
無奈伤痛
無奈伤痛 2021-02-06 02:41

I am have been attempting to get a C++ project setup using boost file system library using eclipse. I followed these directions to install boost on my system. The directions whe

5条回答
  •  清歌不尽
    2021-02-06 03:05

    I just ran into something very similar to this using eclipse and CDT... It turns out, using ubuntu and apt-get, libboost_system installs as libboost_system.1.40.0 in /usr/lib

    If you try to add it via the library tab in Helios it will complain because it is looking for *.so and *.s0.1.40.0 clearly doesn't match that. However after looking closely at what the linker was trying to doo, I just typed the raw string "boost_system" into the include path adder. This resulted in the linker doing a " -lboost_system" which is a format the linker knows how to deal with in resolving version dependency... If you instead put in the full path to the .so file, the linker will just complain because it tries to do a " -l/usr/lib/libboost_system.so.1.40.0" .

    So take my advice and just type in the simple " boost_system" after doing an apt-get install.. It will make it all very easy.

提交回复
热议问题