Boost C++ Libraries: Ticket #4075: undefined reference to `_imp__InterlockedExchange' when compiling interprocess example https://svn.boost.org/trac10/ticket/4075 <p> When compiling the "doc_named_mutex.cpp" example in boost interprocess (version 1.42.0) with mingw64 version 1.0 build 20100322 on Windows 7 Enterprise, I get the following linker error: </p> <pre class="wiki">C:\Users\jay\Desktop\boost_1_42_0\libs\interprocess\example&gt; x86_64-w64-mingw32-g++ doc_named_mutex.cpp C:\Users\jay\AppData\Local\Temp\ccb0rZaR.o:doc_named_mutex.cpp:(.text$_ZN5boost12interprocess6winapi28interlocked_compare_exchangeEPV111[boost::interprocess::winapi::interlocked_compare_exchange(long volatile*, long, long)]+0x25: undefined reference to `_imp__InterlockedCompareExchange' C:\Users\jay\AppData\Local\Temp\ccb0rZaR.o:doc_named_mutex.cpp:(.text$_ZN5boost12interprocess6winapi28interlocked_compare_exchangeEPV111[boost::interprocess::winapi::interlocked_compare_exchange(long volatile*, long, long)]+0x25: undefined reference to `_imp__InterlockedCompareExchange' collect2: ld returned 1 exit status </pre><p> Please note: it is not clear to me if this is a boost interprocess issue or a MinGW64 issue. If it is the latter and I can get a description of the problem, I'm happy to report the bug to the MinGW64 project. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4075 Trac 1.4.3 Steven Watanabe Thu, 08 Apr 2010 19:47:17 GMT <link>https://svn.boost.org/trac10/ticket/4075#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4075#comment:1</guid> <description> <p> Does it work if you compile with -DBOOST_USE_WINDOWS_H? </p> </description> <category>Ticket</category> </item> <item> <author>michael.kane@…</author> <pubDate>Thu, 15 Apr 2010 13:29:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4075#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4075#comment:2</guid> <description> <p> If I compile with -DBOOST_USE_WINDOWS_H, I get a large number of compiler errors. The first few lines read: </p> <pre class="wiki">../../../boost/interprocess/detail/win32_api.hpp:501: error: 'win32_find_data_t' has not been declared ../../../boost/interprocess/detail/win32_api.hpp: In function 'void* boost::interprocess::winapi::find_first_file(const char*, int*)': ../../../boost/interprocess/detail/win32_api.hpp: 502: error: cannot convert 'int*' to '_WIN32_FIND_DATAA*' for argument '2' to 'void* FindFirstFileA(const CHAR*, _WIN32_FIND_DATAA*)' ../../../boost/interprocess/detail/win32_api.hpp: At global scope: ... </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 26 Aug 2010 10:32:31 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4075#comment:3 https://svn.boost.org/trac10/ticket/4075#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> You need to link the appropiate mingw libraries for this. In Visual this function is defined in Kernel32.lib </p> Ticket