Click to See Complete Forum and Search --> : unresolved external symbol __endthreadex


cracel
April 18th, 2003, 06:48 PM
hi gurus,

I am writing a simple windows app. After adding a new class to my project ( a window class that I am working on ) I got a strange error message:

Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/WinTest.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

I am sure you are all laughing at me now. :). But this is the first time I try to write a windows application outside MFC and I am really struggling here. Thank you all for you help.

Roger.

mahanare
April 19th, 2003, 01:19 AM
The reason might be you are using some MFC functions or mfc classes some where, so it needs the following setting.

Project->Settings, in general tab, select "Use MFC in a Shared Dll"
This may work because some time back when i was learning vc++ I got similar errors so i cleared some how. I feel this is the way to do.
so if it doesn't work, get back to me if possible i may be helpful to you in other case you have to wait for other Gurus to help you.

cheers
mahanare

lazycalm
April 19th, 2003, 02:15 AM
If it is a multi-thread program, you should set some setting switch

In Visual C++:

"Project" --> "Setting" -->"C/C++" -->"category" -->"Code generation" --> "User runtime library" -->"MultiThreaded"


If you don't know whether it's a multi-thread program, just do it again.

Ajay Vijay
April 20th, 2003, 05:03 AM
Originally posted by cracel
hi gurus,

I am writing a simple windows app. After adding a new class to my project ( a window class that I am working on ) I got a strange error message:

Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001:
Roger.
You may have just switched to Release from Debug without setting your project settings.
Well, mahanare already gave the answer.
However, lazycalm's reply seems to be unrelated (it would already be MT).

bottle_fish
April 20th, 2003, 05:25 AM
If it is necessary.,I think you should add "stdafx.h" into your .cpp, too. Then set the "using MFC Dll".

cracel
April 20th, 2003, 12:42 PM
Originally posted by mahanare
The reason might be you are using some MFC functions or mfc classes some where, so it needs the following setting.

Project->Settings, in general tab, select "Use MFC in a Shared Dll"
This may work because some time back when i was learning vc++ I got similar errors so i cleared some how. I feel this is the way to do.
so if it doesn't work, get back to me if possible i may be helpful to you in other case you have to wait for other Gurus to help you.

cheers
mahanare

Thank you mahanare,

it worked... now I just wonder which MFC function I am using. That happened after the creation of a new class on my program.

Thank you again,
Roger.

cracel
April 20th, 2003, 12:44 PM
Originally posted by lazycalm
If it is a multi-thread program, you should set some setting switch

In Visual C++:

"Project" --> "Setting" -->"C/C++" -->"category" -->"Code generation" --> "User runtime library" -->"MultiThreaded"


If you don't know whether it's a multi-thread program, just do it again.

hi lazycalm,

it is just a very simple and basic program that opens one main window and a couple of child windows - that by the way do not get focus ever (child with title bar), but that is a topic for another thread :) - and after I created a single very simple class, I started to get this error message.
Adding mfc dynamically to my app worked just fine.

Thank you,
Roger.

cracel
April 20th, 2003, 12:46 PM
Originally posted by bottle_fish
If it is necessary.,I think you should add "stdafx.h" into your .cpp, too. Then set the "using MFC Dll".

Thank you bottle fish, I got some great answers here. But adding MFC DLL alone solved my problem. Now I just need to find which MFC function I am using inside my class.

thank you,
Roger.