unresolved external symbol __endthreadex error Resolution
When debugging with VC6.0, beginners will always encounter some errors, for the following error is mainly because the MFC class library does not refer to the problem.
Error phenomena:
Nafxcwd.lib (thrdcore.obj): Error lnk2001:unresolved external symbol __endthreadex
Nafxcwd.lib (thrdcore.obj): Error lnk2001:unresolved external symbol __beginthreadex
Debug/jnhid.exe:fatal Error Lnk1120:2 unresolved externals
Error executing link.exe.
Ways to resolve errors:
Select Project-settings--general--microsoft Foundation Classes
There are three options in the drop-down list:
1. Not using MFC
2. Use MFC in a Static libray
3. Use MFC in a Shared DLL
This article from Csdn Blog, reproduced please indicate the source: http://blog.csdn.net/Leolzy/archive/2007/01/15/1483489.aspx
Error message:
Nafxcwd.lib (thrdcore.obj): Error lnk2001:unresolved external symbol __endthreadex
Nafxcwd.lib (thrdcore.obj): Error lnk2001:unresolved external symbol __beginthreadex
LIBCD.lib (crt0.obj): Error lnk2001:unresolved external symbol _main
Debug/hello.exe:fatal Error Lnk1120:3 unresolved externals
The first solution:
1. "Project", "Settings"
"Catagory" select "Code Generation"
"Use Run-time Library" select "Debug Multithreaded"
At this point to determine the general problem solving, there may be the following problem prompt:
LIBCMTD.lib (crt0.obj): Error lnk2001:unresolved external symbol _main
Debug/hello.exe:fatal Error lnk1120:1 unresolved externals
At this point, take the second step:
2.
[Project]--[Settings]--Select the "Link" property page,
Change/subsystem:console to/subsystem:windows in Project options
Tip: In the Project Options window, swipe down on the right to find the item!
Summary: After doing the above two steps, solve the problem!
Second workaround:
1. Check if the header file is included Afx.h
2. Open Project->settings->general->microsoft Foundation classes->
Optional MFC in a static library
Or choose the use of MFC in a shared DLL (you need to put MFC's dynamic library under the System32 folder).
I ran into it.
Nafxcwd.lib (thrdcore.obj): Error lnk2001:unresolved external symbol __endthreadex
Nafxcwd.lib (thrdcore.obj): Error lnk2001:unresolved external symbol __beginthreadex
These two lines of error, so the second method to solve the reason is that I call the MFC class library, but the establishment of the console program is not loaded by default MFC class Library, it needs to be changed here settings.
The first method is to search the Internet, encounter a similar problem can be tried.
unresolved external symbol __endthreadex error Resolution