I am trying to build and run the Boost.Log library on VS2010.
I took the latest files from the trunk in their SVN. I dragged all header and source files into a win32 .exe project, setup all of boost's (1.47) include\lib directories. After playing for a while with the .mc file I managed to generate header and .rc files from it.
Also made sure the run-time library is set to Multi-threaded Debug DLL (/MDd).
My main cpp file is this:
#include "stdafx.h"
#in开发者_StackOverflowclude <boost/log/trivial.hpp>
int _tmain(int argc, _TCHAR* argv[]){
BOOST_LOG_TRIVIAL(error) << "An error severity message"; }
Everything compiles but then I get this LINK error:
error LNK1104: cannot open file 'libboost_log_setup-vc100-mt-gd-1_47.lib'
Questions arise: I am building an .exe project, why is this .lib file being looked for? I have the sources and all. How does the linker know the name 'libboost_log_setup-vc100-mt-gd-1_47'? I can't find any of remnant of it in linkage options, nor in the source code.
What can I do here?
It would be best if someone could guide me to an already built and working VS2010 .lib of Boost.Log.
P.S. Before that I have tried to compile a .lib file from the boost.log sources and have another exe project use that. The .lib was built fine. But in the client project I received errors of this sort:
error LNK2019: unresolved external symbol "void __cdecl boost::log_mt_nt5::trivial::aux::init(void)" (?init@aux@trivial@log_mt_nt5@boost@@YAXXZ) referenced in function "public: static class boost::log_mt_nt5::sources::severity_logger_mt __cdecl boost::log_mt_nt5::trivial::logger::construct_logger(void)" (?construct_logger@logger@trivial@log_mt_nt5@boost@@SA?AV?$severity_logger_mt@W4severity_level@trivial@log_mt_nt5@boost@@@sources@34@XZ)
Boost.Log is a compiled library; it needs to be built. You can build it with bjam the same way the rest of boost is built.
The file name being searched for is a result it boost's auto linking. Check out for various options.
精彩评论