Try to compile an example of boost log(1.55), but it pop out the link error like this
main.obj : error LNK2019: unresolved external symbol "void __cdecl boost::log::v2s_mt_nt5::aux::code_convert(unsigned short const *,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::locale const &)" (?code_convert@aux@v2s_mt_nt5@log@boost@@YAXPBGIAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVlocale@6@@Z) referenced in function "private: void __thiscall boost::log::v2s_mt_nt5::basic_formatting_ostream<char,struct std::char_traits<char>,class std::allocator<char> >::aligned_write<unsigned short>(unsigned short const *,int)" (??$aligned_write@G@?$basic_formatting_ostream@DU?$char_traits@D@std@@V?$allocator@D@2@@v2s_mt_nt5@log@boost@@AAEXPBGH@Z)
The codes after simplify
#include <fstream>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/make_shared_object.hpp>
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/sinks/sync_frontend.hpp>
#include <boost/log/sinks/text_ostream_backend.hpp>
#include <boost/log/sources/logger.hpp>
#include <boost/log/sources/record_ostream.hpp>
namespace logging = boost::log;
namespace src = boost::log::sources;
namespace sinks = boost::log::sinks;
void init()
{
// Construct the sink
typedef sinks::synchronous_sink< sinks::text_ostream_backend > text_sink;
boost::shared_ptr< text_sink > sink = boost::make_shared< text_sink >();
}
int main()
{
return 0;
}
This is my qmake file
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
BOOST_LIB_PATH += G:/Tools/3rdLibs/boost/boost_1_55_0/lib32-msvc-9.0
INCLUDEPATH += G:/Tools/3rdLibs/boost/boost_1_55_0
QMAKE_CFLAGS_RELEASE += /MT
QMAKE_CXXFLAGS_RELEASE += /MT
LIBS += $${BOOST_LIB_PATH}/libboost_date_time-vc90-mt-s-1_55.lib
LIBS += $${BOOST_LIB_PATH}/libboost_chrono-vc90-mt-s-1_55.lib
LIBS += $${BOOST_LIB_PATH}/libboost_system-vc90-mt-s-1_55.lib
LIBS += $${BOOST_LIB_PATH}/libboost_filesystem-vc90-mt-s-1_55.lib
LIBS += $${BOOST_LIB_PATH}/libboost_thread-vc90-mt-s-1_55.lib
LIBS += $${BOOST_LIB_PATH}/libboost_log_setup-vc90-mt-s-1_55.lib
LIBS += $${BOOST_LIB_PATH}/libboost_log-vc90-mt-s-1_55.lib
SOURCES += main.cpp
It is compiled by vc2008, win7 32 bits
our applications are using MT, I can't use dynamic link