Click here to Skip to main content
16,012,843 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Inline function causing unresolved symbols. Pin
David Crow24-Jul-03 9:09
David Crow24-Jul-03 9:09 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:19
73Zeppelin24-Jul-03 9:19 
GeneralRe: Inline function causing unresolved symbols. Pin
David Crow24-Jul-03 9:22
David Crow24-Jul-03 9:22 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:24
73Zeppelin24-Jul-03 9:24 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:07
73Zeppelin24-Jul-03 9:07 
GeneralRe: Inline function causing unresolved symbols. Pin
Tim Smith24-Jul-03 9:09
Tim Smith24-Jul-03 9:09 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:13
73Zeppelin24-Jul-03 9:13 
GeneralRe: Inline function causing unresolved symbols. Pin
John M. Drescher24-Jul-03 9:37
John M. Drescher24-Jul-03 9:37 
I know this talks about old versions of the compiler and MFC but I think the result is the same.

SYMPTOMS
When compiling an MFC application using the single-threaded run-time library, you receive the following two unresolved external error messages:


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

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



CAUSE
Starting with version 3.0, all MFC classes are "thread safe" and require the multi-threaded run-time libraries to link successfully. Many people try to use the single-threaded run-time libraries because they assume these libraries are needed to enable the application to run in Win32s. This is not the case. MFC versions 3.0 and later will use a single thread, so as long as you are not creating additional threads in the application, the application will run under Win32s.



RESOLUTION
To avoid these unresolved external errors, do not set the Project Settings to Single-Threaded for an MFC version 3.0 or later application. This setting can be changed by doing the following:

On Visual C 2.x and 5.0:



Select the PROJECT menu (and continue Steps 2 through 5 below).


On Visual C 4.x:


Select the Build menu.


Select the SETTINGS... option.


Select the tab, C/C++.


Select CODE GENERATION on the Category list box.


Finally, make a selection other than SINGLE-THREADED on the Use Run Time Library list box.





STATUS
This behavior is by design.



John
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin25-Jul-03 3:03
73Zeppelin25-Jul-03 3:03 
GeneralRe: Inline function causing unresolved symbols. Pin
Dangleberry25-Jul-03 3:36
sussDangleberry25-Jul-03 3:36 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin25-Jul-03 3:43
73Zeppelin25-Jul-03 3:43 
GeneralRe: Inline function causing unresolved symbols. Pin
John M. Drescher25-Jul-03 4:07
John M. Drescher25-Jul-03 4:07 
GeneralRe: Inline function causing unresolved symbols. Pin
Abin24-Jul-03 14:16
Abin24-Jul-03 14:16 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin25-Jul-03 2:41
73Zeppelin25-Jul-03 2:41 
QuestionHow to pass an "enum" value as a parameter. Pin
WREY24-Jul-03 8:51
WREY24-Jul-03 8:51 
AnswerRe: How to pass an "enum" value as a parameter. Pin
David Crow24-Jul-03 9:01
David Crow24-Jul-03 9:01 
GeneralRe: How to pass an "enum" value as a parameter. Pin
WREY24-Jul-03 11:03
WREY24-Jul-03 11:03 
GeneralRe: How to pass an "enum" value as a parameter. Pin
Michael Dunn24-Jul-03 12:41
sitebuilderMichael Dunn24-Jul-03 12:41 
QuestionHow to fill in data in a list box Pin
Deepak Samuel24-Jul-03 8:28
Deepak Samuel24-Jul-03 8:28 
AnswerRe: How to fill in data in a list box Pin
Maximilien24-Jul-03 8:41
Maximilien24-Jul-03 8:41 
AnswerRe: How to fill in data in a list box Pin
Tom Archer24-Jul-03 8:45
Tom Archer24-Jul-03 8:45 
AnswerRe: How to fill in data in a list box Pin
David Crow24-Jul-03 8:51
David Crow24-Jul-03 8:51 
GeneralRe: How to fill in data in a list box Pin
Tom Archer24-Jul-03 9:17
Tom Archer24-Jul-03 9:17 
GeneralRe: How to fill in data in a list box Pin
David Crow24-Jul-03 9:26
David Crow24-Jul-03 9:26 
GeneralRe: How to fill in data in a list box Pin
Tom Archer24-Jul-03 9:36
Tom Archer24-Jul-03 9:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.