I m trying access an extern device via a serial port and want to use Boost.Asio for this propose. I have build the boost libraries for MinGw and compiled the regex example successful.
但是,如果我列入从波斯特获得的东西,我就难以编纂我的法典。 Asio:
#include <boost/asio/serial_port.hpp>
int main() {
return 0;
}
g++ -D _WIN32_WINNT=0x0501 -O0 -g3 -Wall -c -fmessage-length=0 -osrcSerialPortTest.o ..srcSerialPortTest.cpp
g++ -LC:oost-libsoostin.v2libs hreaduildgcc-mingw-4.5.2
eleaselink-static hreading-multi -LC:oost-libsoostin.v2libssystemuildgcc-mingw-4.5.2
eleaselink-static hreading-multi -oSerialPortTest.exe srcSerialPortTest.o -lboost_thread-mgw45-mt-1_48 -lboost_system-mgw45-mt-1_48
srcSerialPortTest.o: In function `ZN5boost4asio6detail17winsock_init_base7startupERNS2_4dataEhh :
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../include/boost/asio/detail/impl/winsock_init.ipp:39: undefined reference to `WSAStartup@8
srcSerialPortTest.o: In function `ZN5boost4asio6detail17winsock_init_base7cleanupERNS2_4dataE :
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../include/boost/asio/detail/impl/winsock_init.ipp:48: undefined reference to `WSACleanup@0
collect2: ld returned 1 exit status
对我来说,这似乎是一个相互关联的问题,但我没有看到这个问题。