Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

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.
0
fundo_techies
Asked:
fundo_techies
1 Solution
 
jkrCommented:
>>When i included "libcmt.lib" library in the project

You should not do that manually. Instead, go to the project settings, pick the C++ tab, choose 'Code Generation' from the combobox and then select 'Runtime Library: Multithreaded DLL'.
0
 
corduroy9Commented:

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.

0
 
fundo_techiesAuthor Commented:
Thanx a lot..
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now