2012-11-08 63 views
2

我試圖編譯Boost.Log到boost_1_52_0。一旦我來到點,可以執行如下命令:升壓Boost.Log安裝錯誤1.52.0

C:\ boost_1_52_0>的bjam --with日誌變體=調試限定= BOOST_LOG_USE_CHAR限定= B OOST_LOG_USE_WINNT6_API階段--build型=完全--link = 執行配置檢查

編譯未完成,並生成較少的lib文件,一旦我寫了一個hello世界程序來利用boost.log,它抱怨錯誤「錯誤2錯誤LNK1104:無法打開文件'libboost_log-vc100 -mt-gd-1_52.lib'

以下是輸出:

- has_icu builds   : no 

Component configuration: 

    - chrono     : not building 
    - context     : not building 
    - date_time    : not building 
    - exception    : not building 
    - filesystem    : not building 
    - graph     : not building 
    - graph_parallel   : not building 
    - iostreams    : not building 
    - locale     : not building 
    - log      : building 
    - math      : not building 
    - mpi      : not building 
    - program_options   : not building 
    - python     : not building 
    - random     : not building 
    - regex     : not building 
    - serialization   : not building 
    - signals     : not building 
    - system     : not building 
    - test      : not building 
    - thread     : not building 
    - timer     : not building 
    - wave      : not building 

...patience... 
...patience... 
...patience... 
...found 9657 targets... 
...updating 17 targets... 
compile-c-c++ bin.v2\libs\log\build\msvc-10.0\debug\threading-multi\text_file_ba 
ckend.obj 
text_file_backend.cpp 
libs\log\src\text_file_backend.cpp(956) : warning C4244: 'initializing' : conver 
sion from 'unsigned short' to 'unsigned char', possible loss of data 
libs\log\src\text_file_backend.cpp(1197) : error C2039: 'get_generic_category' : 
is not a member of 'boost::system' 
     libs\log\src\text_file_backend.cpp(1169) : while compiling class templat 
e member function 'void boost::log_mt_nt6::sinks::basic_text_file_backend<CharT> 
::do_consume(const boost::log_mt_nt6::basic_record<CharT> &,const std::basic_str 
ing<_Elem,_Traits,_Ax> &)' 
     with 
     [ 
      CharT=char, 
      _Elem=char, 
      _Traits=std::char_traits<char>, 
      _Ax=std::allocator<char> 
     ] 
     libs\log\src\text_file_backend.cpp(1439) : see reference to class templa 
te instantiation 'boost::log_mt_nt6::sinks::basic_text_file_backend<CharT>' bein 
g compiled 
     with 
     [ 
      CharT=char 
     ] 
libs\log\src\text_file_backend.cpp(1197) : error C3861: 'get_generic_category': 
identifier not found 

    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n 
ul 
cl /Zm800 -nologo @"bin.v2\libs\log\build\msvc-10.0\debug\threading-multi\text_f 
ile_backend.obj.rsp" 

...failed compile-c-c++ bin.v2\libs\log\build\msvc-10.0\debug\threading-multi\te 
xt_file_backend.obj... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\threading-multi>boost_log-vc1 
00-mt-gd-1_52.dll for lack of <pbin.v2\libs\log\build\msvc-10.0\debug\threading- 
multi>text_file_backend.obj... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\threading-multi>boost_log-vc1 
00-mt-gd-1_52.lib for lack of <pbin.v2\libs\log\build\msvc-10.0\debug\threading- 
multi>text_file_backend.obj... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\threading-multi>boost_log-vc1 
00-mt-gd-1_52.pdb for lack of <pbin.v2\libs\log\build\msvc-10.0\debug\threading- 
multi>text_file_backend.obj... 
...skipped <pstage\lib>boost_log-vc100-mt-gd-1_52.dll for lack of <pbin.v2\libs\ 
log\build\msvc-10.0\debug\threading-multi>boost_log-vc100-mt-gd-1_52.dll... 
...skipped <pstage\lib>boost_log-vc100-mt-gd-1_52.lib for lack of <pbin.v2\libs\ 
log\build\msvc-10.0\debug\threading-multi>boost_log-vc100-mt-gd-1_52.lib... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\threading-multi>boost_log_set 
up-vc100-mt-gd-1_52.dll for lack of <pbin.v2\libs\log\build\msvc-10.0\debug\thre 
ading-multi>boost_log-vc100-mt-gd-1_52.lib... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\threading-multi>boost_log_set 
up-vc100-mt-gd-1_52.lib for lack of <pbin.v2\libs\log\build\msvc-10.0\debug\thre 
ading-multi>boost_log-vc100-mt-gd-1_52.lib... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\threading-multi>boost_log_set 
up-vc100-mt-gd-1_52.pdb for lack of <pbin.v2\libs\log\build\msvc-10.0\debug\thre 
ading-multi>boost_log-vc100-mt-gd-1_52.lib... 
...skipped <pstage\lib>boost_log_setup-vc100-mt-gd-1_52.dll for lack of <pbin.v2 
\libs\log\build\msvc-10.0\debug\threading-multi>boost_log_setup-vc100-mt-gd-1_52 
.dll... 
...skipped <pstage\lib>boost_log_setup-vc100-mt-gd-1_52.lib for lack of <pbin.v2 
\libs\log\build\msvc-10.0\debug\threading-multi>boost_log_setup-vc100-mt-gd-1_52 
.lib... 
compile-c-c++ bin.v2\libs\log\build\msvc-10.0\debug\link-static\threading-multi\ 
text_file_backend.obj 
text_file_backend.cpp 
libs\log\src\text_file_backend.cpp(956) : warning C4244: 'initializing' : conver 
sion from 'unsigned short' to 'unsigned char', possible loss of data 
libs\log\src\text_file_backend.cpp(1197) : error C2039: 'get_generic_category' : 
is not a member of 'boost::system' 
     libs\log\src\text_file_backend.cpp(1169) : while compiling class templat 
e member function 'void boost::log_mt_nt6::sinks::basic_text_file_backend<CharT> 
::do_consume(const boost::log_mt_nt6::basic_record<CharT> &,const std::basic_str 
ing<_Elem,_Traits,_Ax> &)' 
     with 
     [ 
      CharT=char, 
      _Elem=char, 
      _Traits=std::char_traits<char>, 
      _Ax=std::allocator<char> 
     ] 
     libs\log\src\text_file_backend.cpp(1439) : see reference to class templa 
te instantiation 'boost::log_mt_nt6::sinks::basic_text_file_backend<CharT>' bein 
g compiled 
     with 
     [ 
      CharT=char 
     ] 
libs\log\src\text_file_backend.cpp(1197) : error C3861: 'get_generic_category': 
identifier not found 

    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n 
ul 
cl /Zm800 -nologo @"bin.v2\libs\log\build\msvc-10.0\debug\link-static\threading- 
multi\text_file_backend.obj.rsp" 

...failed compile-c-c++ bin.v2\libs\log\build\msvc-10.0\debug\link-static\thread 
ing-multi\text_file_backend.obj... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\link-static\threading-multi>l 
ibboost_log-vc100-mt-gd-1_52.lib for lack of <pbin.v2\libs\log\build\msvc-10.0\d 
ebug\link-static\threading-multi>text_file_backend.obj... 
...skipped <pstage\lib>libboost_log-vc100-mt-gd-1_52.lib for lack of <pbin.v2\li 
bs\log\build\msvc-10.0\debug\link-static\threading-multi>libboost_log-vc100-mt-g 
d-1_52.lib... 
compile-c-c++ bin.v2\libs\log\build\msvc-10.0\debug\link-static\runtime-link-sta 
tic\threading-multi\text_file_backend.obj 
text_file_backend.cpp 
libs\log\src\text_file_backend.cpp(956) : warning C4244: 'initializing' : conver 
sion from 'unsigned short' to 'unsigned char', possible loss of data 
libs\log\src\text_file_backend.cpp(1197) : error C2039: 'get_generic_category' : 
is not a member of 'boost::system' 
     libs\log\src\text_file_backend.cpp(1169) : while compiling class templat 
e member function 'void boost::log_mt_nt6::sinks::basic_text_file_backend<CharT> 
::do_consume(const boost::log_mt_nt6::basic_record<CharT> &,const std::basic_str 
ing<_Elem,_Traits,_Ax> &)' 
     with 
     [ 
      CharT=char, 
      _Elem=char, 
      _Traits=std::char_traits<char>, 
      _Ax=std::allocator<char> 
     ] 
     libs\log\src\text_file_backend.cpp(1439) : see reference to class templa 
te instantiation 'boost::log_mt_nt6::sinks::basic_text_file_backend<CharT>' bein 
g compiled 
     with 
     [ 
      CharT=char 
     ] 
libs\log\src\text_file_backend.cpp(1197) : error C3861: 'get_generic_category': 
identifier not found 

    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n 
ul 
cl /Zm800 -nologo @"bin.v2\libs\log\build\msvc-10.0\debug\link-static\runtime-li 
nk-static\threading-multi\text_file_backend.obj.rsp" 

...failed compile-c-c++ bin.v2\libs\log\build\msvc-10.0\debug\link-static\runtim 
e-link-static\threading-multi\text_file_backend.obj... 
...skipped <pbin.v2\libs\log\build\msvc-10.0\debug\link-static\runtime-link-stat 
ic\threading-multi>libboost_log-vc100-mt-sgd-1_52.lib for lack of <pbin.v2\libs\ 
log\build\msvc-10.0\debug\link-static\runtime-link-static\threading-multi>text_f 
ile_backend.obj... 
...skipped <pstage\lib>libboost_log-vc100-mt-sgd-1_52.lib for lack of <pbin.v2\l 
ibs\log\build\msvc-10.0\debug\link-static\runtime-link-static\threading-multi>li 
bboost_log-vc100-mt-sgd-1_52.lib... 
...failed updating 3 targets... 
...skipped 14 targets... 

回答

2

此版本的Boost.Log使用已棄用的'get_generic_category()'函數,該函數現在已從Boost.System中刪除。因此,您可以降級升級,也可以手動將Boost.Log更改爲get_generic_category()generic_category()(還有get_system_category()system_category()等)。

UPDATE似乎我錯:根據documentation,上述功能仍然存在,除非BOOST_SYSTEM_NO_DEPRECATED被定義。所以檢查Boost.Log是否定義它。

3

經過數小時的嘗試,boost Boost 1.52.0上的boost filesyetem V3存在一個問題,它與boost.log版本1.1不兼容。所以,它需要使用「svn」來下載Boost.Log v2中繼。命令如下:

SVN共同https://boost-log.svn.sourceforge.net/svnroot/boost-log升壓日誌

然後,我執行以下步驟:

  1. 複製「助推\日誌」文件夾形式升壓登錄到「\ boost_1_52_0 \助推「文件夾
  2. 複製‘庫\登錄’文件夾從升壓登錄到‘\ boost_1_52_0 \庫’文件夾
  3. 在命令提示符下,走‘boost_1_52_0’文件夾,執行」 bootstrap.bat - show-libraries「
  4. 在「boost_1_52_0」文件夾中,執行「b2.exe」

手指交叉,您可能會在編譯結束時收到以下消息。

... 
compile-c-c++ bin.v2\libs\log\build\msvc-10.0\release\link-static\threading-mult 
i\default_filter_factory.obj 
default_filter_factory.cpp 
msvc.archive bin.v2\libs\log\build\msvc-10.0\release\link-static\threading-multi 
\libboost_log_setup-vc100-mt-1_52.lib 
common.copy stage\lib\libboost_log_setup-vc100-mt-1_52.lib 
bin.v2\libs\log\build\msvc-10.0\release\link-static\threading-multi\libboost_log 
_setup-vc100-mt-1_52.lib 
     1 file(s) copied. 
...updated 87 targets... 


The Boost C++ Libraries were successfully built! 

The following directory should be added to compiler include paths: 

    D:/boost_1_52_0 

The following directory should be added to linker library paths: 

    D:\boost_1_52_0\stage\lib 
+0

好的。這在2012-12-07當然是有用的 –