gpt4 book ai didi

logging - Boost 1.52.0 上的 Boost.Log 安装错误

转载 作者:行者123 更新时间:2023-12-02 05:24:32 25 4
gpt4 key购买 nike

我试图将 Boost.Log 编译到 boost_1_52_0 中。一旦我到了要执行以下命令的地步:

C:\boost_1_52_0>bjam --with-log variant=debug define=BOOST_LOG_USE_CHAR define=BOOST_LOG_USE_WINNT6_API 阶段 --build-type=complete --link=执行配置检查

编译未完成,生成的lib文件较少,有一次我写了一个hello world程序利用boost.log,报错“Error 2 error LNK1104: cannot open file '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...

最佳答案

经过数小时的尝试,Boost 1.52.0 上的 boost filesyetem V3 出现问题,与 boost.log 版本 1.1 不兼容。所以,它需要使用“svn”来下载Boost.Log v2 trunk。命令如下:

svn公司https://boost-log.svn.sourceforge.net/svnroot/boost-log boost 日志

然后,我执行以下步骤:

  1. 将“boost\log”文件夹从 boost-log 复制到“\boost_1_52_0\boost”文件夹
  2. 将“libs\log”文件夹从 boost-log 复制到“\boost_1_52_0\libs”文件夹
  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

关于logging - Boost 1.52.0 上的 Boost.Log 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13285714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com