Archived

This topic is now archived and is closed to further replies.

Link Error: unresolved external symbol __endthreadex

This topic is 5503 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is what my debugger outputs when I try to compile an mfc-application: ------------------------ Linking... nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex Elysium.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. ------------------------ Can anybody tell me what might cause this? I have no idea what to do about it... If you need any other info feel free to ask... Thanks in advance

Share this post


Link to post
Share on other sites
you''re using multiple threads, but building with a single-threaded crt. use multithreaded crt instead (project settings->code generation).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you are going to use mfc classes in the new thread, use AfxBeginThread instead of _beginthreadex and AfxEndThread instead of _endthreadex.

Share this post


Link to post
Share on other sites
Uhhhhhhh.... first off all thanks for all the help! Incredible I just love this forum it keeps amazing me

But... I have no clue what a thread is, and where it starts/ends

The Project Settings -> Code Generation menu does not exist here tho... I can go to Project -> Settings, but there''s nothing like that in there (VC++ 6)

Can you people plz give me a little more help on how to make this work? Thanks a lot people!

Share this post


Link to post
Share on other sites
Look at all the settings in all perference sections. You will see a collection of settings for core program and DLL multithreading.

You are not required to use AfxBeginThread in MFC. You may use the C++ run-time _beginthreadex. Just understand that you should always use one of the two at any given moment. Lastly, do not end a thread via termination. That should be the last resort such as when a program destructor.

Kuphryn

Share this post


Link to post
Share on other sites