Solved

mfc linking

Posted on 2002-03-09
2
472 Views
Last Modified: 2013-11-20
Hi!
i wrote a graphical library (dxmanager.lib, based on direct 3d), it works perfectly with win32 apps, but if i try to use it with an mfc app, i got these 2 links error (by the way, i've never defined a "Lockit" method in my lib).

msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in dxmanager.lib(dxmanager.obj)

msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(void)" (??0_Lockit@std@@QAE@XZ) already defined in dxmanager.lib(dxmanager.obj)


could anyone help me?
regards, Ralph
0
Comment
Question by:ralph78
2 Comments
 
LVL 7

Accepted Solution

by:
peterchen092700 earned 50 total points
Comment Utility
Check the VC Runtime Library settings in your LIB match those you have with the MFC App (Project/Settings/C-C++/Code Generation: Use Run-time library)

LIB's default to "Single Threaded", but MFC required either "Multi Threaded DLL" or "Multi Threaded", depending on whenther you ling statically or dynamically to the MFC DLL's

(Though you usually get more than just two error messages on this)

std::_Lockit is an STL helper class for multithreading support, which gets a "do nothing" implementation in single-thread builds.

Peter

0
 

Author Comment

by:ralph78
Comment Utility
That's ok now!
thx, and sorry to be late ;-))

regards, Ralph
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sum13 challenge 24 77
has77  challenge 9 67
noX challenge 17 75
Detect file exist or not 3 76
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now