2

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 stage --build-type=complete --link= 構成チェックを実行しています

コンパイルが完了せず、生成される lib ファイルが少なくなりました。boost.log を利用する hello world プログラムを作成すると、「エラー 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...
4

2 に答える 2

3

何時間も試行した後、Boost 1.52.0 の boost ファイルシステム V3 に問題があり、これは boost.log バージョン 1.1 と互換性がありません。そのため、「svn」を使用して Boost.Log v2 トランクをダウンロードする必要があります。コマンドは次のとおりです。

svn co https://boost-log.svn.sourceforge.net/svnroot/boost-logブースト-ログ

次に、次の手順を実行します。

  1. 「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
于 2012-11-08T13:17:37.250 に答える
2

このバージョンの Boost.Log は、Boost.System から削除された非推奨の「get_generic_category()」関数を使用します。そのため、Boost をダウングレードするか、手動で Boost.Logget_generic_category()generic_category()(およびetcget_system_category()system_category()) 変更するパッチを適用できます。

更新私は間違っているようです:ドキュメントによると、 BOOST_SYSTEM_NO_DEPRECATEDが定義されていない限り、上記の関数はまだ存在しています。したがって、Boost.Log で定義されているかどうかを確認してください。

于 2012-11-08T09:24:42.100 に答える