win7 codeblock在调用boost::asio中遇到的错误———解决办法

错误一:    undefined reference to `boost::system::generic_category()'
         undefined reference to `boost::system::generic_category()'
         undefined reference to `boost::system::system_category()'

解决办法:在boost的system库的error_code.hpp源代码中添加:

                #define BOOST_ERROR_CODE_HEADER_ONLY

错误二:undefined reference to wsastartup

解决办法:工具 -> 编译选项 -> 编译器    选中连接器命令行并加入下列命令:-lwsock32


你可能感兴趣的:(win7 codeblock在调用boost::asio中遇到的错误———解决办法)