Solved

mfc linking

Posted on 2002-03-09
2
478 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
[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 Comments
 
LVL 7

Accepted Solution

by:
peterchen092700 earned 50 total points
ID: 6854277
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
ID: 6914220
That's ok now!
thx, and sorry to be late ;-))

regards, Ralph
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

696 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