boost lib error
-
Hi guys......
please help how to slove this problem
after adding boost libraries im getting these errors...........................error: undefined reference to `boost::system::detail::system_category_ncx()' error:undefined reference to `boost::system::detail::generic_category_ncx()' collect2.exe:-1: error: error: ld returned 1 exit status
this is header file
error_code.hpp
here im getting errorinline const error_category & system_category() BOOST_SYSTEM_NOEXCEPT { return detail::system_category_ncx(); } inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT { return detail::generic_category_ncx(); }
-
i added this is .pro file
INCLUDEPATH += $$PWD/../../external/include
DEPENDPATH += $$PWD/../../external/lib/boostCONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_random-x32
else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_random-x32-gdCONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_system-x32
else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_system-x32-gdCONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_date_time-x32
else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_date_time-x32-gd -
Boost::system
could be built statically using its source code, I think it is better than linking libraries. -
hello bharth,,,,
follow these steps bcz it doesnt work with lib files so alrdy u hv built boost libraries so rebuild it as below,,
1.download boost
2.build boost in command prompt (else install developer command prompt)
3.while building u should add these paths,,
drive name (ex. D: then click on enter)
cd enter path where ur boost has downloaded(ex. cd D:\boost_1_68_0) click on enter & add
bootstrap.bat again click on enter wait until it completes itz building after that add this path
b2 toolset=gcc (it takes some time to build if u find any error after adding this ,,,error like command not recognised gc++...etc then install mingw then it works fine )
after building u get .a files do copy paste into ur lib folder . -
@Bharth
I Prefer building boost using CMake GUI using suitable compiler.
Steps: https://svn.boost.org/trac10/wiki/CMakeConfigAndBuild#ConfiguretheBoostsourcetreeWhat compile do you use? What are the binaries you use build with ? What is the build configuration of those libraries?
-
INCLUDEPATH += $$PWD/../../external/include
win32: DEPENDPATH += $$PWD/../../external/lib/boost/win32/
else:unix: DEPENDPATH += $$PWD/../../external/lib/boost/mac/win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_random-mgw63-x32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_random-mgw63-d-x32
else:unix: LIBS += -L$$PWD/../../external/lib/boost/mac -lboost_randomwin32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_system-mgw63-x32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_system-mgw63-d-x32
else:unix: LIBS += -L$$PWD/../../external/lib/boost/mac -lboost_systemwin32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_date_time-mgw63-x32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_date_time-mgw63-d-x32
else:unix: LIBS += -L$$PWD/../../external/lib/boost/mac -lboost_date_timewin32: LIBS += -lws2_32
bharth change path name & add last line into pro.file