Link to home
Start Free TrialLog in
Avatar of fundo_techies
fundo_techies

asked on

linking problem in VC++

I am getting a linking error "error LNK2001: unresolved external symbol __beginthreadex". When i included "libcmt.lib" library in the project settings (link tab) [Projects->Settings->Link tab (Project Options)] i started getting the following errors :

LIBCD.lib(crt0dat.obj) : error LNK2005: __cinit already defined in libcmt.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in libcmt.lib(crt0dat.obj)
.............
.............
.............
.............

Now while going through the MSDN library, i found "Linker Tools Error LNK2001" topic in which i found errors "Linking code compiled with /MT with the library LIBC.LIB causes LNK2001 on _beginthread, _beginthreadex, _endthread, and _endthreadex" and "Linking code compiled with an explicit or implicit /ML to the LIBCMT.LIB causes LNK2001 on _errno" under the head "Compiling and Linking Problems" listed.

I m not able to find out the solution for this problem. Kindly help asap. Thanx.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of corduroy9
corduroy9


When I get _beginthread and _endthreadex link errors, I go to Project\Settings\General tab and change the dropdown for Microsoft Foundation Classes from "Not using MFC" to Use MFC in a Shared DLL.  That usually resolves the problem.

Avatar of fundo_techies

ASKER

Thanx a lot..