I'm trying to get the Boost library working in my C++ projects in Eclipse. I can successfully build when using header-only libraries in Boost such as the example simple program in the "Getting Started" guide using the lambda header.
I cannot get my project to successfully link to the regex Boost library as shown later in the guide. Under my project properties -> c/c++ build -> settings -> tool settings tab -> libraries, I have added "libboost_regex" to the Libraries box, and "C:\Program Files\boost\boost_1_42_0\bin.v2\libs" to the Library search path box since this is where all the .lib files are. I've even tried adding "libboost_regex-mgw34-mt-d-1_42.lib" to the libraries box instead of "libboost_regex" since that is the exact file name, but this did not work either.
I keep getting an error that says "cannot find -llibboost_regex" when I try to build my project. Any ideas as to how I can fix this?
Edit: on Windows XP, using mingw, and I have tried "boost_regex" as well..
I just went through the whole process of installing MinGW, compiling boost and installing Eclipse CDT and I'm able to compile simple programs using boost:regex
. I'll write down all the steps. I hope that can be of help.
I've installed MinGW and MSYS in their default location.
Here are the step I took to build boost:
C:\mingw\boost_1_42_0
cd /c/mingw/boost_1_42_0
bjam --build-dir=build toolset=gcc stage
To configure Eclipse:
In "C/C++ General" > "Paths and Symbols"
C:\MinGW\boost_1_42_0
C:\MinGW\boost_1_42_0\stage\lib
In "C/C++ Build" > "Settings"
libboost_regex-mgw34-mt-d
(without the .lib) You can then go through the same steps for the Release configuration but use libboost_regex-mgw34-mt
instead. Also make sure your source files include <boost/regex.hpp>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With