Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with linking files using boost::log with CMake Buildfile
From: David Georg Reichelt (davidgeorg_reichelt_at_[hidden])
Date: 2013-12-07 14:40:59

Am 07.12.2013 17:15, schrieb Steven Watanabe:
> On 12/07/2013 04:15 AM, David Georg Reichelt wrote:
>> Am 06.12.2013 16:59, schrieb Steven Watanabe:
>>> AMDG
>>>> <snip>
>>>> ADD_DEFINITIONS("-std=c++0x")
>>>> SET(BOOST_ROOT "C:/cppLib/boost_1_55_0/")
>>>> link_libraries (${Boost_LIBRARIES})
>>>> find_package( Boost 1.54.0 COMPONENTS log)
> Wait a minute. Shouldn't link_libraries
> come /after/ find_package? Does the link
> command line show that you are linking
> to boost_log?
Thanks again for the advice! Yes, in the first place it was like this,
but after Andy told me that it should be in the if-block it is moved
after find_package. The full code now is here:

But after that, I googled if there is any hint what I could be doing
wrong linking boost log. I found the following thread:
It basiacally says that one has to add multiple libraries to get boost
log running and that one has to get them in a certain order. After
addding them (so now find_package uses find_package( Boost 1.55.0
COMPONENTS system thread filesystem date_time log log_setup REQUIRED)
and the code like in I got the errors:

undefined reference to `std::ios_base::Init::~Init()'
undefined reference to `std::ios_base::Init::Init()'
CMakeFiles\Hasselbrack.dir/objects.a(main.cpp.obj): bad reloc addr
ection `.rdata'
final link failed: Invalid operation
collect2.exe: Fehler: ld gab 1 als Ende-Status zurück

So something still does not work with the linker... Do you have any idea
> In Christ,
> Steven Watanabe
Best Regards,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at