Jump to content
  • Advertisement
Sign in to follow this  
mrmrcoleman

Compile error...

This topic is 4842 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
Advertisement
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);
#endif



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

Mark

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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!