Advertisement Jump to content
Sign in to follow this  

Compile error...

This topic is 4904 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

I get the following errors when I compile.. C:\Documents and Settings\Mark\StarChart\Testing\Hierachical Screen Test\Main.cpp(345) : error C2065: '_endthreadex' : undeclared identifier C:\Documents and Settings\Mark\StarChart\Testing\Hierachical Screen Test\Main.cpp(433) : error C2065: '_beginthreadex' : undeclared identifier Refering to these two lines..
1. _endthreadex(1);

2. GlobalThreadHandle = (HANDLE)_beginthreadex(0,0,CommThread,0,0,0 );

I have process.h in my headers. I can't think what the problem could be? Mark

Share this post

Link to post
Share on other sites
Ok, I think I found the problem. In process.h, the definition of these methods is inside a preprocessor conditional which looks like this.

#ifdef _MT
_CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
unsigned, void *);
_CRTIMP void __cdecl _endthread(void);
_CRTIMP unsigned long __cdecl _beginthreadex(void *, unsigned,
unsigned (__stdcall *) (void *), void *, unsigned, unsigned *);
_CRTIMP void __cdecl _endthreadex(unsigned);

Obviously _MT, is not being set on my machine. Does anybody know what it is?


Share this post

Link to post
Share on other sites
You need to set your project to use the multithreaded version of the C runtime library. (Compiler switch /MD, /MDd, /MT or /MTd. Or just go to the C/C++ portion of the project properties under Code Generation.)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!