Menu

#1594 MINGW: Cannot build C::B, missing link to boost_system library.

Undefined
open
nobody
None
Bug_Report
4 days ago
4 days ago
No

After some time, I recompiled the sources of C::B with x86_64-w64-mingw32 for making a newer build, but I got this error when linking:

  CXXLD    libNassiShneiderman.la
/usr/lib/gcc/x86_64-w64-mingw32/14/../../../../x86_64-w64-mingw32/bin/ld: .libs/CParser.o:CParser.cpp:(.text$_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0x2e): undefined reference to `boost::system::generic_category()'
/usr/lib/gcc/x86_64-w64-mingw32/14/../../../../x86_64-w64-mingw32/bin/ld: .libs/CParser.o:CParser.cpp:(.text$_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0x71): undefined reference to `boost::system::generic_category()'
/usr/lib/gcc/x86_64-w64-mingw32/14/../../../../x86_64-w64-mingw32/bin/ld: .libs/CParser.o:CParser.cpp:(.text$_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0xf1): undefined reference to `boost::system::generic_category()'
/usr/lib/gcc/x86_64-w64-mingw32/14/../../../../x86_64-w64-mingw32/bin/ld: .libs/CParser.o:CParser.cpp:(.text$_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition[_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition]+0x2c): undefined reference to `boost::system::generic_category()'
/usr/lib/gcc/x86_64-w64-mingw32/14/../../../../x86_64-w64-mingw32/bin/ld: .libs/CParser.o:CParser.cpp:(.text$_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition[_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition]+0xc1): undefined reference to `boost::system::generic_category()'
collect2: error: ld returned 1 exit status

I did an hack on the Makefile created by the configure script and I just added -lboost_system by hand in the target that was failing and the problem has been solved.
As result, I have been able to continue the build until the end and I got my new C::B installation.

I also wanted to provide a patch for the Makefile.am that needs this addition, but I have not found any other target that needs to be linked to the boost libraries, so I'm reporting this as a bug.

I hope that you will find this useful and it could be fixed.

Discussion

  • Miguel Gimenez

    Miguel Gimenez - 4 days ago

    In recent boost libraries the system library is header-only, so detection of the library failed. Which version of boost are you using?

    EDIT: the change was made in 1.69, a binary stub was left for compatibility until 1.89. In 1.70 and 1.88 the binary exists and only exports dummy_exported_function()

     

    Last edit: Miguel Gimenez 4 days ago
    • Carlo Bramini

      Carlo Bramini - 4 days ago

      I'm using boost-1.66.0-1

       

Log in to post a comment.

MongoDB Logo MongoDB