mercredi 29 juillet 2015

Linking boost.asio with C++11 enabled

I'm trying to build some program with g++ with -std=c++11 option. Program uses boost::asio.
I compiled it in windows with msvc1013 successfully.

But gcc 4.9.2 gives me a link error:

SomeFile.cpp:(.text+0x2c5): undefined reference to `boost::asio::ip::address::address(boost::asio::ip::address&&)'
SomeFile.cpp:(.text+0x2dc): undefined reference to `boost::asio::ip::address::address(boost::asio::ip::address&&)'

code whitch produce this error:

void someFunction(const QVarinat& value)
{
    .....
    boost::asio::ip::address adr = value.value<boost::asio::ip::address>();
    .....
}

I've tried to rebuild boost from sources with this command:

./bjam variant=release link=static runtime-link=shared toolset=gcc cxxflags="-std=c++11" 

Aucun commentaire:

Enregistrer un commentaire