title: Boost threads creating InterlockedCompareExchange Errors on mingw32
body: <p>After googling for InterlockedCompareExchange errors, it seems like it always points to an old error for mingw64, and I am using mingw32.</p>
  
  <p>It seems to happen to all examples that use threads, but if I just have "<code>#include &lt;boost/thread.hpp&gt;</code>" and no calls of a thread it will work, so I think I did the linking correct.</p>
  
  <p>This is my build:</p>
  
  <pre><code>-------------- Build: Debug in UDP_EXAMPLE (compiler: GNU GCC Compiler)---------------
  
  mingw32-g++.exe -Wall -D_WIN32_WINNT=0x0501 -g -IC:\boost_1_56_0 -c "C:\Users\poteto\Desktop\Other Programming\UDP_EXAMPLE\server.cpp" -o obj\server.o
  In file included from C:\boost_1_56_0/boost/thread/win32/thread_data.hpp:11:0,
                   from C:\boost_1_56_0/boost/thread/thread_only.hpp:15,
                   from C:\boost_1_56_0/boost/thread/thread.hpp:12,
                   from C:\boost_1_56_0/boost/thread.hpp:13,
                   from C:\Users\poteto\Desktop\Other Programming\UDP_EXAMPLE\server.cpp:5:
  C:\boost_1_56_0/boost/thread/win32/thread_primitives.hpp:180:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
  mingw32-g++.exe  -o Debug\http_server.exe obj\server.o  -lws2_32 -lwsock32  C:\boost_1_56_0\stage\lib\libboost_thread-mgw47-mt-1_56.a C:\boost_1_56_0\stage\lib\libboost_system-mgw47-mt-1_56.a
  C:\boost_1_56_0\stage\lib\libboost_thread-mgw47-mt-1_56.a(thread.o):thread.cpp:(.text$_ZN5boost6detail5win3223GetTickCount64emulationEv+0x1e): undefined reference to `_InterlockedCompareExchange'
  C:\boost_1_56_0\stage\lib\libboost_thread-mgw47-mt-1_56.a(thread.o):thread.cpp:(.text$_ZN5boost6detail5win3223GetTickCount64emulationEv+0x70): undefined reference to `_InterlockedCompareExchange'
  C:\boost_1_56_0\stage\lib\libboost_thread-mgw47-mt-1_56.a(thread.o):thread.cpp:(.text$_ZN5boost6detail5win3223GetTickCount64emulationEv+0xb5): undefined reference to `_InterlockedCompareExchange'
  collect2.exe: error: ld returned 1 exit status
  Process terminated with status 1 (0 minute(s), 11 second(s))
  3 error(s), 1 warning(s) (0 minute(s), 11 second(s))
  </code></pre>
  
  <p>I linked the libraries: libboost_thread and libboost_system. I am using Codeblocks. Other asio examples without threads work. </p>
  
  <p>In the example:<a href="http://www.ce.unipr.it/~medici/udpserver2.html" rel="nofollow">http://www.ce.unipr.it/~medici/udpserver2.html</a></p>
  
  <p>If I were to remove the call to the thread, it would work.</p>