Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I find out which libraries I need to include when my link fails in Visual C++

Posted on 2004-10-14
3
Medium Priority
?
238 Views
Last Modified: 2010-04-24
Visual C++ (not .net)

My immediate problem is that the link fails -

unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)

I'd like to find out the library I need to include to find this function (AfxEndThread) and the method so that I can find any other unresolved references that may occur - ever.
0
Comment
Question by:rfr1tz
[X]
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
  • 2
3 Comments
 
LVL 19

Expert Comment

by:drichards
ID: 12314878
What kind of project did you create?  AfxEndThread is an MFC function and _endthreadex is a C runtime function.  You need to link with a C runtime library such as msvcrtd.lib (debug multithreaded dll).  This should be automatic if you created an MFC project.  If it is not an MFC project, you should not use AfxEndThread.
0
 
LVL 19

Accepted Solution

by:
drichards earned 1000 total points
ID: 12314944
As far as finding the libaries you need, you can look at the MS docs for the function in question.  They include information such as the header to include, the platforms on which the function is supported, and the library to link with.  See, for example, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__endthread.2c_._endthreadex.asp.  The "Libraries" section has a link to the C-runtime libraries page because this is not a simple use library x answer.
0
 
LVL 12

Expert Comment

by:OnegaZhang
ID: 12332197
The problem seems that you are using multithread feature but you are linking to single threaded library.
Please try the following steps:

Open project property dialog, goes to C/C++ --> Code generation

Runtime library : select Multithread ... to use multithreaded library.

welcome to www.fruitfruit.com
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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