The use of mingw to learn boost is a trigger. If you want to avoid detours, you should use the compilers that come with windows. Open-source Dongdong is really hard to see and trouble on Microsoft's platform.
Let's talk about the compiling environment: win7 64-bit flagship edition, mingw 4.4, and boost 1.53. All the libraries are generated as static libraries (. a) The source file is the first example in the boost ASIO document. The file name is changed to timer_sync.cpp.
Two problems were encountered during the connection:
The first problem is that the corresponding macro option is not specified and needs to be solved using the-D parameter. For details, refer.
The second problem is that the library ws2_32.dll is not linked.
First of all, in order to convenient command, the need to link the Library to the directory: copy the boost main directory lib directory of the libboost_date_time-mgw44-mt-1_53.a and libboost_system-mgw44-mt-1_53.a to the directory, remove-mgw44-mt when renaming (of course, if you don't feel tired of typing the command, you can also rename it to a shorter file name, depending on your preferences .)
Second, download the sw_32.dll file online.
Http://cn.dll-files.com/ws2_32.dll.html
Download and decompress the package, and copy it to the local directory.
Third, enter the following command:
Note that the macro 0x0501 is used here, indicating that the platform is XP, but win7 is compatible.
Timer_sync.exe is generated.ProgramThe program will output the string after 5 seconds.