www.digitalmars.com         C & C++   DMDScript  

c++ - Undefined identifier

reply "Max Veen" <marove wanadoo.nl> writes:
Hello everyone,

I'am trying to create a thread with _beginthread() that uses a C-runtime
library. I have included <process.h> in my program. After compiling with
DMC, I got the message 'Undefined identifier _beginthread and undefined
identifier _endthread'. How is that possible?

When I explicitely declare the _beginthread() and _endthread functions in my
program, the DMC compiler (V8.38) compiles with no errors and warnings.
But after building the program the Output window gives 2 errors: 'Symbol
Undefined ?_beginthreadxxxxx(0 and Symbol Undefined ?_endthreadxxxxxxx().
So, what could be the reason for these errors?
Do I have to include a special library in my project, so the build process
will then be fine?
I can't come out of this problem. Is there anyone who has experience with
these thread functions?

Help would be greatly appriciated!

Regards,

Max Veen
Mar 17 2004
parent reply "Matthew" <matthew stlsoft.org> writes:
to use the functions in process.h you must define _MT, via the appropriate
option. I assume they're the same as with VC++, i.e. -MD, -MT, -MDd, -MTd,
but I can't say for sure off the top of my head. Check out the DMC++ website

"Max Veen" <marove wanadoo.nl> wrote in message
news:c394en$107h$1 digitaldaemon.com...
 Hello everyone,

 I'am trying to create a thread with _beginthread() that uses a C-runtime
 library. I have included <process.h> in my program. After compiling with
 DMC, I got the message 'Undefined identifier _beginthread and undefined
 identifier _endthread'. How is that possible?

 When I explicitely declare the _beginthread() and _endthread functions in
my
 program, the DMC compiler (V8.38) compiles with no errors and warnings.
 But after building the program the Output window gives 2 errors: 'Symbol
 Undefined ?_beginthreadxxxxx(0 and Symbol Undefined ?_endthreadxxxxxxx().
 So, what could be the reason for these errors?
 Do I have to include a special library in my project, so the build process
 will then be fine?
 I can't come out of this problem. Is there anyone who has experience with
 these thread functions?

 Help would be greatly appriciated!

 Regards,

 Max Veen
Mar 18 2004
parent reply "Max Veen" <marove wanadoo.nl> writes:
Matthew, what kind of option do you mean when using _MT? Do I have to define
this in a headerfile?
Maybe you can give me an example.

Best regards,
-- 
Max Veen
Mar 23 2004
parent "Matthew" <matthew stlsoft.org> writes:
It would be a command-line build. Unless it is defined, process.h will not
declare the CRT threading functions.

AFAICT, DMC++ goes along with the VC++ standard of _MT

"Max Veen" <marove wanadoo.nl> wrote in message
news:c3pk53$1ce8$1 digitaldaemon.com...
 Matthew, what kind of option do you mean when using _MT? Do I have to
define
 this in a headerfile?
 Maybe you can give me an example.

 Best regards,
 -- 
 Max Veen
Mar 24 2004