BOOST- undefined reference to `boost::system::generic_category()'
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: BOOST- undefined reference to `boost::system::generic_category()'

  1. #1
    Join Date
    Dec 2015
    Posts
    8

    BOOST- undefined reference to `boost::system::generic_category()'



    Code:
    #include <boost/thread/thread.hpp>
    #include <iostream>
    
    void hello() {
    std::cout<<"Hello, World\n";
    }
    
    int main() {
    boost::thread thrd(&hello);
    thrd.join();
    }
    ||=== Build: Debug in B4 (compiler: GNU GCC Compiler) ===|
    obj\Debug\B4.o||In function `_static_initialization_and_destruction_0':|
    E:\BOOST\boost_1_60_0\boost\system\error_code.hpp|221|undefined reference to `boost::system::generic_category()'|
    E:\BOOST\boost_1_60_0\boost\system\error_code.hpp|222|undefined reference to `boost::system::generic_category()'|
    E:\BOOST\boost_1_60_0\boost\system\error_code.hpp|223|undefined reference to `boost::system::system_category()'|
    obj\Debug\B4.o||In function `ZN5boost16thread_exceptionC2EiPKc':|
    E:\BOOST\boost_1_60_0\boost\thread\exceptions.hpp|51|undefined reference to `boost::system::system_category()'|
    obj\Debug\B4.o||In function `ZN5boost6detail16thread_data_baseC2Ev':|
    E:\BOOST\boost_1_60_0\boost\thread\win32\thread_data.hpp|135|undefined reference to `vtable for boost:etail::thread_data_base'|
    obj\Debug\B4.o||In function `ZN5boost6thread12start_threadEv':|
    E:\BOOST\boost_1_60_0\boost\thread\detail\thread.hpp|178|undefined reference to `boost::thread::start_thread_noexcept()'|
    obj\Debug\B4.o||In function `ZN5boost6threadD1Ev':|
    E:\BOOST\boost_1_60_0\boost\thread\detail\thread.hpp|253|undefined reference to `boost::thread:etach()'|
    obj\Debug\B4.o||In function `ZN5boost6thread4joinEv':|
    E:\BOOST\boost_1_60_0\boost\thread\detail\thread.hpp|763|undefined reference to `boost::thread::get_id() const'|
    E:\BOOST\boost_1_60_0\boost\thread\detail\thread.hpp|763|undefined reference to `boost::this_thread::get_id()'|
    E:\BOOST\boost_1_60_0\boost\thread\detail\thread.hpp|768|undefined reference to `boost::thread::join_noexcept()'|
    obj\Debug\B4.o||In function `ZN5boost6detail11thread_dataIPFvvEED1Ev':|
    E:\BOOST\boost_1_60_0\boost\thread\detail\thread.hpp|90|undefined reference to `boost:etail::thread_data_base::~thread_data_base()'|
    ||=== Build failed: 11 error(s), 0 warning(s) (1 minute(s), 54 second(s)) ===|

  2. #2
    Join Date
    Oct 2008
    Posts
    1,449

    Re: BOOST- undefined reference to `boost::system::generic_category()'

    boost::thread is not header only; you must compile it to your preferred architecture target and link ( either statically or dynamically ). alternatively, all major compilers supports std::thread now that is part of the runtime lib.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)