Page 1 of 1

Cannot compile boost program with Codelite

Posted: Tue Oct 18, 2016 10:17 am
by Durango2011
I have a program which is utilizing the boost library, however when I try building my code with Codelite I am getting the following errors:

Code: Select all

/bin/sh -c '/usr/bin/make -j4 -e -f  Makefile'
----------Building project:[ SecureObjectStoreServer - Debug ]----------
make[1]: Entering directory '/home/dizzy/Programming/C++/SecureObjectStore/SecureObjectStoreServer'
/usr/bin/g++-5 -o ./Debug/SecureObjectStoreServer @"SecureObjectStoreServer.txt" -L/usr/lib/x86_64-linux-gnu/  -L.
./Debug/main.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
I checked to find the location of the boost library needed and found that the path is /usr/lib/x86_64-linux-gnu/libboost_system.so

I then tried to add this within the build settings in Codelite so that I can properly compile the program. The menu is settings->build settings->Compilers tab.

Then I select the Advanced tab and enter the following values under the Global Paths section: Include Path: /usr/include/boost/

Libraries Path: /usr/lib/x86_64-linux-gnu/

I did not change anything else in settings.

However, it does not seem to fix this issue.

I am able to properly compile boost programs via command line using gcc and adding the -lboost_system flag. This works fine so the issue really is configuring Codelite to do this.

I searched online for help on this but I did not find anything that fixes my issue.

I am running Codelite v.9.1.0. on Ubuntu 16.04 (Xenial)

Thanks for any suggestions! :)

Re: Cannot compile boost program with Codelite

Posted: Tue Oct 18, 2016 11:36 am
by eranif
Did you truncate the build log?
It seems missing some information

Re: Cannot compile boost program with Codelite

Posted: Wed Oct 19, 2016 7:37 am
by Durango2011
Sorry about that for some reason I missed full message.

Here it is:

Code: Select all

/bin/sh -c '/usr/bin/make -j4 -e -f  Makefile'
----------Building project:[ SecureObjectStoreServer - Debug ]----------
make[1]: Entering directory '/home/peyman/Programming/C++/SecureObjectStore/SecureObjectStoreServer'
/usr/bin/g++-5 -o ./Debug/SecureObjectStoreServer @"SecureObjectStoreServer.txt" -L/usr/lib/x86_64-linux-gnu/  -L.
./Debug/main.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
/usr/include/boost/system/error_code.hpp:221: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::system_category()'
./Debug/main.cpp.o: In function `boost::system::error_code::error_code()':
/usr/include/boost/system/error_code.hpp:322: undefined reference to `boost::system::system_category()'
./Debug/main.cpp.o: In function `boost::asio::error::get_system_category()':
/usr/include/boost/asio/error.hpp:230: undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status
SecureObjectStoreServer.mk:76: recipe for target 'Debug/SecureObjectStoreServer' failed
make[1]: *** [Debug/SecureObjectStoreServer] Error 1
make[1]: Leaving directory '/home/peyman/Programming/C++/SecureObjectStore/SecureObjectStoreServer'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2
====6 errors, 0 warnings====
Thanks for any help!

Re: Cannot compile boost program with Codelite

Posted: Wed Oct 19, 2016 9:51 am
by eranif
From the link line:
/usr/bin/g++-5 -o ./Debug/SecureObjectStoreServer @"SecureObjectStoreServer.txt" -L/usr/lib/x86_64-linux-gnu/ -L.
It seems you are missing the boost libraries.

Add the proper boost libraries from: project settings->linker->libraries

Re: Cannot compile boost program with Codelite

Posted: Wed Oct 19, 2016 10:10 am
by Durango2011
Ty so much I was looking under different settings (build settings->compiler->linker options), which did not seem to work.
Now it's working :)