Cry about...
MS-Windows Troubleshooting


error LNK2001: unresolved external symbol __endthreadex


Symptom:

Microsoft Visual C++ generates the link error:

uafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
uafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex

Possible Cause:

A library that is being used was built as a multithreaded DLL, however the application is only single threaded.

Remedy:

Change the application to multithreaded. To do this:

  1. Go to Project Settings and select the 'C/C++' tab.
  2. Select 'Code Generation' in Category.
  3. Set ‘Use run-time library’ to either ‘Debug Multithreaded’ (for debug builds) or ‘Multithreaded’ (for release builds).

My thanks to PHAM Duy Minh for pointing out a missing step in this sequence.


The following additional information has been contributed by Sujith Joseph:

There is another way of getting:

error LNK2001: unresolved external symbol __endthreadex

In Projects|Settings|General forgetting to set "Using MFC in a Static Library". If you do this in your debug build you get:

nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex

If you do forget to set this option in the release build you get:

nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.