linking problem in VC++

Posted on 2003-02-27
Medium Priority
Last Modified: 2010-05-18
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.
Question by:fundo_techies
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 86

Accepted Solution

jkr earned 200 total points
ID: 8033392
>>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'.

Expert Comment

ID: 8033576

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.


Author Comment

ID: 8040119
Thanx a lot..

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question