1

I am trying to compile a test main :

#define BOOST_SYSTEM_NO_DEPRECATED
#include <boost/system/error_code.hpp>
#include <iostream>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

int main()
{
        return 0;
}

but I get this error line :

/tmp/ccrTZTdB.o: In function `boost::system::system_category()':
main.cpp:(.text._ZN5boost6system15system_categoryEv[_ZN5boost6system15system_categoryEv]+0x5): undefined reference to `boost::system::detail::system_category_ncx()'

And I used this command line :

g++ main.cpp -L/usr/lib -I/usr/include -lpthread -lboost_system

How can I solve this issue?

Justin
  • 24,288
  • 12
  • 92
  • 142
Wywy77
  • 11
  • 1

0 Answers0