www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - link error - (void cdecl _endthread(void ))

reply Nicholas Jordan <Nicholas_member pathlink.com> writes:
Build failed ....

Function declaration;
void __cdecl _endthread(void);

in // L:\itc\methods.cpp - 33972 characters, 3817 words, 1007 lines

copied right out of:
#include <process.h>

gets: Symbol Undefined ?_endthread  YAXXZ \
(void cdecl _endthread(void ))


I have tried to dig into this link error many times in
different projects, compilers and project types: If
someone can tell me exactly how to go about digging this
out, they could probably make a lot of money as a
computer honcho and wouldn't have time for me.

;-)

But if I try to build my program without getting into
threading, I'll be

:-(

Eventually, I will include windows.h ~ these things
ought to be kernel objects anyway due to buffer
consistency issues, but right now I am very much in the
cut, paste, try & cry development phase. Usually, in the
past, I would start a whole new project, in another
directory; copy useful code over and paste it on to new
files created in the new project. This raises it's own
set of challenges, most of which are the same as what
one tried to get away from, now with additional issues
confusing the thought field.

Eventually, I got to the point of looking for a disk-wipe
utility ~ but about that time, my re-install disks went the
way of the newbie that believed everything he read in the
"Documentation" of those compilers.

DM has a different world viewport, so now I have obj2asm.exe
and Digital Mars Librarian Version 8.00n on the tools menu
of my editor:

link /CO /NOI /DE /NOPACKF /XN /NT /ENTRY:mainCRTStartup \
/BAS:4194304 /A:512  itc.LNK
Error: L:\out\methods.OBJ(methods)  (125048554): \
Symbol Undefined ?_endthread  YAXXZ (void cdecl _endthread(void ))
Errors: 1  Warnings: 0
Build failed

So running the librarian did not seem to fix it:
-c L:\itc\lib\itc  L:\out\Inventory.obj L:\out\methods.obj

So,... suggestions ?
Dec 18 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"Nicholas Jordan" <Nicholas_member pathlink.com> wrote in message 
news:do4ak0$2efs$1 digitaldaemon.com...
 gets: Symbol Undefined ?_endthread  YAXXZ \
 (void cdecl _endthread(void ))
_endthread is defined in snn.lib. But ?_endthread YAXXZ is not. This means that you've got _endthread declared as a C++ function, when it should be a C function.
Dec 19 2005
parent reply Nicholas Jordan <Nicholas_member pathlink.com> writes:
In article <do74ca$1gj9$3 digitaldaemon.com>, Walter Bright says...
"Nicholas Jordan" <Nicholas_member pathlink.com> wrote in message 
news:do4ak0$2efs$1 digitaldaemon.com...
 gets: Symbol Undefined ?_endthread  YAXXZ \
 (void cdecl _endthread(void ))
_endthread is defined in snn.lib. But ?_endthread YAXXZ is not. This means that you've got _endthread declared as a C++ function, when it should be a C function.
Doesn't putting __cdecl in the declaration do this ? Compiler switch -cpp, maybe if I put it in a ..... here I go guessing, enough traffic from me already. I copied the declaration right out of the header file stated in the help files. I will try the suggested fix, no shortage of fixes to try while I bullet-proof this thing. Thanx, Nick
Dec 23 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"Nicholas Jordan" <Nicholas_member pathlink.com> wrote in message 
news:dogtj2$1hoe$1 digitaldaemon.com...
 In article <do74ca$1gj9$3 digitaldaemon.com>, Walter Bright says...
"Nicholas Jordan" <Nicholas_member pathlink.com> wrote in message
news:do4ak0$2efs$1 digitaldaemon.com...
 gets: Symbol Undefined ?_endthread  YAXXZ \
 (void cdecl _endthread(void ))
_endthread is defined in snn.lib. But ?_endthread YAXXZ is not. This means that you've got _endthread declared as a C++ function, when it should be a C function.
Doesn't putting __cdecl in the declaration do this ? Compiler switch -cpp, maybe if I put it in a ..... here I go guessing, enough traffic from me already. I copied the declaration right out of the header file stated in the help files. I will try the suggested fix, no shortage of fixes to try while I bullet-proof this thing.
You need extern "C" as well for it.
Dec 23 2005
parent Nicholas Jordan <Nicholas_member pathlink.com> writes:
In article <doj1mo$30q8$2 digitaldaemon.com>, Walter Bright says...

[snipped]
You need extern "C" as well for it. 
Done, along with about 200 lines of code changed around. Many of my early design concepts are now being laid down fluently in code. I have a fastpath func() which is critical - the entire operation of the executable hinges on it. I noticed in the help files while digging for the above and other things there are some bit-ops which are noted as "bringing the full force of the code engine to bear on (bit-ops)" Are these instructs effective in the program described below: sc methods.cpp -cpp -HO -mn -C -o+time -WA -S -3 -a8 -c -e -gf -Deq_===\ -D_CONSOLE=1 -IL:\dm\stlport\stlport -oL:\out\methods.obj sc diction_.cpp -cpp -HO -mn -C -WA -S -5 -a8 -Nc -c -H -HDL:\itc\pch -e\ -gf -Deq_=== -D_CONSOLE=1 -IL:\dm\stlport\stlport -oL:\out\diction_.obj sc itc.cpp -cpp -HO -mn -C -WA -S -5 -a8 -Nc -c -H -HDL:\itc\pch -e -gf\ -Deq_=== -D_CONSOLE=1 -IL:\dm\stlport\stlport -oL:\out\itc.obj _WIN32 C plusplus compilation link /CO /NOI /DE /NOPACKF /XN /NT /ENTRY:mainCRTStartup /BAS:4194304 /A:512 itc.LNK ren L:\out\exe\$SCW$.EXE itc.EXE L:\out\exe\itc.EXE built Lines Processed: 80017 Errors: 0 Warnings: 0 Successful build A dog will treat you like one of the family; A cat will treat you like one of the staff.....
Dec 24 2005