johnsla
asked on
VC++ 6 LNK 2001 unresolved __endtreadeex __beginthreadex
Im getting the following on Link and can't figure out why these are unresolved for my current project.
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/VwBlktoVst.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
VwBlktoVst.exe - 3 error(s), 0 warning(s)
This is a standalone console app. of which of done before without this problem. As a default the paths
Include directories
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
Lib directories
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB
are by default defined under the Tools|Options directories Tab.
Nowhere am I making an explicit call to
beginthreadex or endthreadex. Any ideas
nafxcwd.lib also resides/lives in C:\Program Files\Microsoft Visual Studio\VC98\LIB on my desktop.
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/VwBlktoVst.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
VwBlktoVst.exe - 3 error(s), 0 warning(s)
This is a standalone console app. of which of done before without this problem. As a default the paths
Include directories
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
Lib directories
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB
are by default defined under the Tools|Options directories Tab.
Nowhere am I making an explicit call to
beginthreadex or endthreadex. Any ideas
nafxcwd.lib also resides/lives in C:\Program Files\Microsoft Visual Studio\VC98\LIB on my desktop.
Did you #include <process.h>?
ASKER
Never had to before and I am simply taking and old app that complies and runs and modifing it a bit. I would not know which of my C++ modules would need it but I'll look into this Fri.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The libraries you are using with mutithreaded one, so change your application settings fm single threaded to multithreaded.
under project settings
select catagory - code generation and
set runtime library - multithread/ debug multithread..
under project settings
select catagory - code generation and
set runtime library - multithread/ debug multithread..
Linking code compiled with /MT with the library LIBC.LIB causes LNK2001 on _beginthread, _beginthreadex, _endthread, and _endthreadex
ASKER
Never had to before and I am simply taking and old app that complies and runs and modifing it a bit. I would not know which of my C++ modules would need it but I'll look into this Fri.
ASKER
Both snifonq and pphri are correct. To be fair snifonq answered first so the points I guess will be assigned appropriately?
I still get the following warning. Not really sure where the linker wants me to change this. Once cleared up I will Accept the answer as Excellent
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
I still get the following warning. Not really sure where the linker wants me to change this. Once cleared up I will Accept the answer as Excellent
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
ASKER
One further comment adding the /nodefaultlib in the link tab of the Project|settings gets rid of the warning allright but causes 54 errors
if u r not using beginthread in your program u could avoid LIBCMT library
add in the linker settings like this
/NODEFAULTLIB:LIBCMT.LIB
add in the linker settings like this
/NODEFAULTLIB:LIBCMT.LIB
ASKER
One further comment adding the /nodefaultlib in the link tab of the Project|settings gets rid of the warning allright but causes 54 errors
ASKER
Answer accepted