[Boost-users] [Boost.Log] How to link with on MSVC 2008?

13 views
Skip to first unread message

RUOFF, LARS (LARS)** CTR **

unread,
Oct 5, 2010, 11:40:55 AM10/5/10
to boost...@lists.boost.org
Hello,
i have found the following instructions to build Boost.Log:
 
> Boost.Log can be compiled by:
>
> 1. Getting 1.42 source release
> 2. Unpacking Boost.Log on top of it
> 3. Following the usual procedure:
>
> .\bootstap.bat
> .\bjam --with-log
 
I did the above starting from a 1.44 source release.
This worked out well.
 
But when trying to use the library I get a lot of linker errors in my project:
 
1>Linking...
1>libboost_log-vc90-mt-gd-1_44.lib(text_file_backend.obj) : error LNK2019: unresolved external symbol "class boost::filesystem2::file_status [...]
(Very long error messages containing decorated names. The above is just the start)
 
Linker path settings should be correct, since the linker correctly finds libboost_log-vc90-mt-gd-1_44.lib.
Also the project is using other Boost libraries (Asio, shared-ptr, bind, posix-time, etc) without problems.
 
Anyone managed to compile and use Boost.Log on MSVC 2008 and can help?
Thank you,
Lars Ruoff
 
 

Igor R

unread,
Oct 5, 2010, 11:53:42 AM10/5/10
to boost...@lists.boost.org
> 1>Linking...
> 1>libboost_log-vc90-mt-gd-1_44.lib(text_file_backend.obj) : error LNK2019:
> unresolved external symbol "class boost::filesystem2::file_status [...]
> (Very long error messages containing decorated names. The above is just the
> start)
>
> Linker path settings should be correct, since the linker correctly finds
> libboost_log-vc90-mt-gd-1_44.lib.
> Also the project is using other Boost libraries (Asio, shared-ptr, bind,
> posix-time, etc) without problems.

Just a guess: Log depends on Boost.Filesystem library, and you haven't
compiled it.
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

RUOFF, LARS (LARS)** CTR **

unread,
Oct 5, 2010, 12:11:12 PM10/5/10
to boost...@lists.boost.org
No,
Because I just made a test:
When I use stuff from Boost.Filesystem
Like
boost::filesystem::remove_all( "foobar" );
boost::filesystem::create_directory( "foobar" );
it links well.

Lars

RUOFF, LARS (LARS)** CTR **

unread,
Oct 8, 2010, 8:05:28 AM10/8/10
to boost...@lists.boost.org
Any other ideas?
Did anyone manage to link with Boost.Log on a MSCV 2008 project?
How did you compile the library?

Regards,
Lars


-----Original Message-----
From: boost-use...@lists.boost.org [mailto:boost-use...@lists.boost.org] On Behalf Of Igor R
Sent: mardi 5 octobre 2010 17:54
To: boost...@lists.boost.org
Subject: Re: [Boost-users] [Boost.Log] How to link with on MSVC 2008?

Roger Stewart

unread,
Oct 8, 2010, 8:54:08 AM10/8/10
to boost...@lists.boost.org
> -----Original Message-----
> From: boost-use...@lists.boost.org [mailto:boost-users-
> bou...@lists.boost.org] On Behalf Of RUOFF, LARS (LARS)** CTR **
> Sent: Friday, October 08, 2010 8:05 AM
> To: boost...@lists.boost.org
> Subject: Re: [Boost-users] [Boost.Log] How to link with on MSVC 2008?
>


Can you compile/link the Boost.Log trivial example?

Roger S.

RUOFF, LARS (LARS)** CTR **

unread,
Oct 8, 2010, 9:23:20 AM10/8/10
to boost...@lists.boost.org
Ok, well, i got this working now.
Thanks for your input Roger - it put me back on track!

The things is:

#include <boost/log/trivial.hpp>
BOOST_LOG_TRIVIAL(trace) << "A trace severity message";

(like in the trivial tutorial)
gives me the linker errors (but compiles ok).

But with additionally including
#include <boost/filesystem.hpp>
it will link ok.

Anyone know why?

regards,

Torri, Stephen CIV NSWCDD, W15

unread,
Oct 8, 2010, 9:37:02 AM10/8/10
to boost...@lists.boost.org

>From: boost-use...@lists.boost.org on behalf of RUOFF, LARS (LARS)** CTR **
>Sent: Fri 10/8/2010 9:23 AM

>To: boost...@lists.boost.org
>Subject: Re: [Boost-users] [Boost.Log] How to link with on MSVC 2008?
>
>Ok, well, i got this working now.
>Thanks for your input Roger - it put me back on track!
>
>The things is:
>
>#include <boost/log/trivial.hpp>
>BOOST_LOG_TRIVIAL(trace) << "A trace severity message";
>
>(like in the trivial tutorial)
>gives me the linker errors (but compiles ok).
>
>But with additionally including
>#include <boost/filesystem.hpp>
>it will link ok.
>
>Anyone know why?

All I can guess, without seeing the errors, is that the Log library will create a file with the name of the process for storing the information. So I can see why it would need the boost filesystem but not sure why linking errors are resolved by including the header. Can you post the linker error?

Stephen

RUOFF, LARS (LARS)** CTR **

unread,
Oct 8, 2010, 11:18:33 AM10/8/10
to boost...@lists.boost.org
Hi,
I posted part of it in my first message.
Here's the complete messages (some are really long) attached as a txt file.

Lars

boost-log-without-filesystem-included-linker-errors.txt
Reply all
Reply to author
Forward
0 new messages