boost.asio lib and CodeLite

CodeLite installation/troubleshooting forum
Teemu
CodeLite Curious
Posts: 2
Joined: Tue Mar 13, 2012 4:39 pm
Genuine User: Yes
IDE Question: C++
Contact:

boost.asio lib and CodeLite

Post by Teemu »

Hi group!
I have installed CodeLite +MinGw+ Unit Test 1.3 on a Win7 system. Now I want to add the boost.asio library to CodeLite... But I don´t really know how to do this! I downloaded the boost_1_49_0 file and extracted it under C:\Program Files\boost_1_49_0\. I found a test-Code, but it doesn´t work... What I have to do, that Codelite knows where the boost-file is and how to use it????

Code: Select all

#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

int main()
{
  boost::asio::io_service io;
boost::system::error_code error; 

  boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
  t.wait();

  std::cout << "Hello, world!\n";

  return 0;
}
after debugging the code the following warnings appeared...
./Debug/main.o: In function `_static_initialization_and_destruction_0':
c:/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
c:/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
c:/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()
Maybe someone can help me... Would be very nice!!! ;)
PS: sry, for my bad english I´m from germany...
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: boost.asio lib and CodeLite

Post by jfouche »

Hi

You have to build boost.Asio, as it's not a "header only" library.
Jérémie
Teemu
CodeLite Curious
Posts: 2
Joined: Tue Mar 13, 2012 4:39 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: boost.asio lib and CodeLite

Post by Teemu »

Thank you, for your quick response!!!
Ok, I have to build boost.asio.... but how and where? sry, I´m a newbie in this...
Your Link explains it, but I don´t really understand what I´ve to do...
You may build the subset of Boost libraries required to use Boost.Asio and its examples by running the following command from the root of the Boost download package:
-->bjam --with-system --with-thread --with-date_time --with-regex --with-serialization stage
What does this exactly mean? Which program I use to "run" the command? Which "root" they mean? I´m really an idoit, sry..
Maybe someone can explain the building of boost.asio step by step... :D
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: boost.asio lib and CodeLite

Post by jfouche »

This has nothing to do in CodeLite forums.
You should read the boost.Build documentation (bjam) and, if you encounter problems, you should go to a boost forum.
Good luck ;) as boost is not so easy for newbies...
Jérémie
Post Reply