unresolved external symbol __endthreadex error Resolution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.