我正在尝试在 NetBeans 中构建一个测试用例 async_tcp_echo_server.cpp,但我没有去。
代码: http: //www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp
我的属性:
Project Properties -> C++ Compiler -> Include Directories = C:/boost/boost_1_53_0
Project Properties -> C++ Compiler -> Tool = g++.exe
Project Properties -> Linker -> Additional Library Directories = C:/boost/boost_1_53_0
错误:
g++.exe -c -g -D_WIN32_WINNT=0x0501 -D__USE_W32_SOCKETS -I/cygdrive/C/boost/boost_1_53_0 -MMD -MP -MF build/Debug/Cygwin_1-Windows/main.o.d -o build/Debug/Cygwin_1-Windows/main.o main.cpp
main.cpp:138:2: warning: no newline at end of file
mkdir -p dist/Debug/Cygwin_1-Windows
g++.exe -o dist/Debug/Cygwin_1-Windows/ub build/Debug/Cygwin_1-Windows/main.o -L/cygdrive/C/boost/boost_1_53_0
build/Debug/Cygwin_1-Windows/main.o: In function `_Z41__static_initialization_and_destruction_0ii':
/cygdrive/C/boost/boost_1_53_0/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/cygdrive/C/boost/boost_1_53_0/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/cygdrive/C/boost/boost_1_53_0/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
build/Debug/Cygwin_1-Windows/main.o: In function `_ZN5boost4asio21stream_socket_serviceINS0_2ip3tcpEE16shutdown_serviceEv':
/cygdrive/C/boost/boost_1_53_0/boost/asio/detail/impl/win_iocp_socket_service_base.ipp:(.text$_ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x7): undefined reference to `boost::system::system_category()'
... ETC ...