Hi I'm trying to build a demo example from boost C++ And I get the following errors when building
g++.exe -Wall -fexceptions -std=c++11 -g -IC:\boost -c C:\api\api\main.cpp -o obj\Debug\main.o g++.exe -LC:\boost\stage\lib -o bin\Debug\api.exe obj\Debug\main.o C:\boost\stage\lib\libboost_system-vc142-mt-gd-x64-1_75.lib C:\boost\stage\lib\libboost_filesystem-vc142-mt-gd-x64-1_75.lib obj\Debug\main.o: In function
main': C:/api/api/main.cpp:31: undefined reference to
boost::filesystem::path::make_preferred()' C:/api/api/main.cpp:34: undefined reference toboost::filesystem::path::begin() const' C:/api/api/main.cpp:34: undefined reference to
boost::filesystem::path::end() const'
Judging by what I found on the internet: this,this, and this I need to rebuild boost with C++11 support and build my project by explicitly specifying the standard.
I built boost again by running:
C:\boost>b2.exe toolset=gcc cxxflags="-std=c++11"
When building my project, I will add a key
-std=c++11
But I get all the same errors, and the tips from the Internet do not work for me, tell me how to overcome this problem?