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
Solved

mfc linking

Posted on 2002-03-09
2
476 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error on moodle after upgrade 3 140
FizzBuzz challenge 9 82
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 103
I could not set window to top 4 20
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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