Boost-log cannot build libboost_log

Help
Anonymous
2012-03-25
2013-06-03
  • Anonymous - 2012-03-25

    i download source code version 1.1 for buliding source code of boost-log. That show error as below.
    libs/log/src/text_file_backend.cpp: In member function ‘void boost::log_mt_posix::sinks::basic_text_file_backend<CharT>::do_consume(const typename boost::log_mt_posix::sinks::basic_formatting_sink_backend<CharT, CharT, boost::log_mt_posix::sinks::frontend_synchronization_tag>::record_type&, const typename boost::log_mt_posix::sinks::basic_formatting_sink_backend<CharT, CharT, boost::log_mt_posix::sinks::frontend_synchronization_tag>::target_string_type&)’:
    libs/log/src/text_file_backend.cpp:1197: error: ‘get_generic_category’ is not a member of ‘boost::system’

     
  • Andrey Semashev

    Andrey Semashev - 2012-03-31

    What Boost version do you use? Did you define BOOST_SYSTEM_NO_DEPRECATED?

     
  • Yu Zhang

    Yu Zhang - 2012-06-30

    I have the same problem when building boost-log-1.1 with boost 1.50.0. Here is how I did it. I extracted the boost_1_50_0.tar.gz to $BOOST_1_50_0 and unzipped boost-log-1.1.zip to $BOOST-LOG

    ln -s $BOOST-LOG/boost/log $BOOST_1_50_0/boost/log
    ln -s $BOOST-LOG/libs/log $BOOST_1_50_0/libs/log
    cd $BOOST_1_50_0
    ./bootstrap.sh
    ./b2 --without-log
    

    Then I got all boost-1.50 libraries successfully built. After that, I tried to build boost-log:

    ./b2 --with-log
    

    Unfortunately, I got the following error message:

    gcc.compile.c++ bin.v2/libs/log/build/gcc-4.4.3/release/threading-multi/text_file_backend.o
    libs/log/src/text_file_backend.cpp: In member function void boost::log_mt_posix::sinks::basic_text_file_backend<CharT>::do_consume(const typename boost::log_mt_posix::sinks::basic_formatting_sink_backend<CharT, CharT, boost::log_mt_posix::sinks::frontend_synchronization_tag>::record_type&, const typename boost::log_mt_posix::sinks::basic_formatting_sink_backend<CharT, CharT, boost::log_mt_posix::sinks::frontend_synchronization_tag>::target_string_type&):
    libs/log/src/text_file_backend.cpp:1197: error: get_generic_category is not a member of boost::system
        "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -fno-strict-aliasing -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_DLL -DBOOST_LOG_USE_NATIVE_SYSLOG=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG  -I"." -c -o "bin.v2/libs/log/build/gcc-4.4.3/release/threading-multi/text_file_backend.o" "libs/log/src/text_file_backend.cpp"
    ...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-4.4.3/release/threading-multi/text_file_backend.o...
    ...skipped <pbin.v2/libs/log/build/gcc-4.4.3/release/threading-multi>libboost_log.so.1.50.0 for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/threading-multi>text_file_backend.o...
    ...skipped <pstage/lib>libboost_log.so.1.50.0 for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/threading-multi>libboost_log.so.1.50.0...
    ...skipped <pstage/lib>libboost_log.so for lack of <pstage/lib>libboost_log.so.1.50.0...
    ...skipped <pbin.v2/libs/log/build/gcc-4.4.3/release/threading-multi>libboost_log_setup.so.1.50.0 for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/threading-multi>libboost_log.so.1.50.0...
    ...skipped <pstage/lib>libboost_log_setup.so.1.50.0 for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/threading-multi>libboost_log_setup.so.1.50.0...
    ...skipped <pstage/lib>libboost_log_setup.so for lack of <pstage/lib>libboost_log_setup.so.1.50.0...
    gcc.compile.c++ bin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi/text_file_backend.o
    libs/log/src/text_file_backend.cpp: In member function void boost::log_mt_posix::sinks::basic_text_file_backend<CharT>::do_consume(const typename boost::log_mt_posix::sinks::basic_formatting_sink_backend<CharT, CharT, boost::log_mt_posix::sinks::frontend_synchronization_tag>::record_type&, const typename boost::log_mt_posix::sinks::basic_formatting_sink_backend<CharT, CharT, boost::log_mt_posix::sinks::frontend_synchronization_tag>::target_string_type&):
    libs/log/src/text_file_backend.cpp:1197: error: get_generic_category is not a member of boost::system
        "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fno-strict-aliasing -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_NATIVE_SYSLOG=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG  -I"." -c -o "bin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi/text_file_backend.o" "libs/log/src/text_file_backend.cpp"
    ...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi/text_file_backend.o...
    ...skipped <pbin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi>libboost_log.a(clean) for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi>text_file_backend.o...
    ...skipped <pbin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi>libboost_log.a for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi>text_file_backend.o...
    ...skipped <pstage/lib>libboost_log.a for lack of <pbin.v2/libs/log/build/gcc-4.4.3/release/link-static/threading-multi>libboost_log.a...
    ...failed updating 2 targets...
    ...skipped 9 targets...
    
     
  • Andrey Semashev

    Andrey Semashev - 2012-06-30

    The macro is defined, so something must have changed in 1.50. I'll look into it.

     
  • Mark Snelling

    Mark Snelling - 2012-08-16

    Did you manage to solve this problem? If so do you have a patch?

     
  • Andrey Semashev

    Andrey Semashev - 2012-08-16

    I committed the fix in SVN. Check out branches/v1 and try if it helps.

     
  • Mark Snelling

    Mark Snelling - 2012-08-17

    Unfortunately I still get a similar error. Bearing in mind I'm building with Boost 1.50.0 and MSVC 11 (Visual Studio 2012).

    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 template member function 'void boost::log_mt_nt
    5::sinks::basic_text_file_backend<CharT>::do_consume(const boost::log_mt_nt5::basic_record<CharT> &,const std::basic_str
    ing<_Elem,_Traits,_Alloc> &)'
            with
            [
                CharT=char,
                _Elem=char,
                _Traits=std::char_traits<char>,
                _Alloc=std::allocator<char>
            ]
            libs\log\src\text_file_backend.cpp(1439) : see reference to class template instantiation 'boost::log_mt_nt5::sin
    ks::basic_text_file_backend<CharT>' being compiled
            with
            [
                CharT=char
            ]
    libs\log\src\text_file_backend.cpp(1197) : error C3861: 'get_generic_category': identifier not found
    
     
  • Andrey Semashev

    Andrey Semashev - 2012-08-17

    There is no call to get_generic_category at text_file_backend.cpp:1197 in the code I see. Please verify you're using the right code.

    Also, as I see now you're building in MSVC. Boost.Thread 1.50 has a bug on this platform, see here.

     
  • Andrey Semashev

    Andrey Semashev - 2012-08-17

    Also, depending on the MSVC version you use, you may be affected by this problem.

     
  • Mark Snelling

    Mark Snelling - 2012-08-17

    Ok thanks. I think I'll skip 1.50.0 and wait for 1.51.0 that should address the first MSVC bug you mnetioned. WRT the second bug, that's fixed in the RTM version of MSVC that I'm using.
    I'll take a look at 1.51 RC1 now.

     
  • Mark Snelling

    Mark Snelling - 2012-08-17

    Both 1.51 RC1 and Boost.Log v1 both compile without issue.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks