undefined reference to `boost::system::detail::generic_category_ncx()'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

undefined reference to `boost::system::detail::generic_category_ncx()'

Boost - Users mailing list
Hello all,
I am new to boost.

I try to use some boost files in my program, but I have trouble with some of them.
For example 
compiling the following program

#include <boost/log/expressions/formatters/date_time.hpp>

int main()
{
  return 0;
}

with the command 
g++ -std=c++11 test.cpp -o main -I/home/user101/boost/ -L/home/user101/boost
 I have a message like the following

/tmp/ccm6UOud.o: In function `boost::system::generic_category()':
test.cpp:(.text._ZN5boost6system16generic_categoryEv[_ZN5boost6system16generic_c                                                         ategoryEv]+0x5): undefined reference to `boost::system::detail::generic_category                                                         _ncx()'

I also tried to append -lboost_system in the command, but I take back the following message:
/usr/bin/ld: cannot find -lboost_system
collect2: error: ld returned 1 exit status

Could you please guide me with that? I use boost_1_67 if that makes any difference (which I do not think so).

Thanks,
Antonis

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: undefined reference to `boost::system::detail::generic_category_ncx()'

Boost - Users mailing list
AMDG

On 09/20/2018 02:59 AM, Antonis Polykratis via Boost-users wrote:
> <snip>
> I also tried to append -lboost_system in the command, but I take back the
> following message:
> /usr/bin/ld: cannot find -lboost_system
> collect2: error: ld returned 1 exit status
>
> Could you please guide me with that? I use boost_1_67 if that makes any
> difference (which I do not think so).
>

You're on the right track here, but you need
to build boost_system and add it to the linker
path before you can use it.

See:
https://www.boost.org/more/getting_started/unix-variants.html#prepare-to-use-a-boost-library-binary

In Christ,
Steven Watanabe
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users