This blog is about developing Windows applications using Visual Studio. All postings on this weblog are provided "AS IS" with no warranties, and confer no rights. Use of any samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Your host Nikola Dudar is a Program Manager in Windows division of Microsoft Corporation. He has been working on Windows Web Services API during Windows 7 and various additions to Visual C++ during VS2005 and VS2008. More details are in LinkedIn profile under Nikola's formal name Mykola Dudar.
If you are interested in program management and project management, check out my other blog at http://www.pmsnack.com/ where I collect best practices and other topics interesting to program and project managers.
To send feedback, comments or requests for new posts, please use the contact form.
If you link your MFC application that consumes MFC static lib, often you may encounter a situation when your app dynamically links to MFC and your library statically links to MFC. When you build this application and you are going to get similar to ones listed below:
1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'mfc80ud.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'mfcs80ud.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
To resolve these errors, you need to link to MFC in one way across your solution. It can be either statically or dynamically and you need to decide which one you need. Then check Project Properties for all projects in your solution. Look for /D_AFXDLL. Look for how /MD[d] vs. /MT[d]. All your projects have to have one setting here - either all of them define _AFXDLL and do /MDd, or none defines _AFXDLL and all of them statically linked to MFC.
Note that I do not actively post on MFC framework anymore because it was not the main area of my focus. Last years I was posting on web services, program and project management. Below are some other posts on MFC:
If you have questions and need more help in integrating Windows Forms in your MFC applications, please ask questions on Visual C++ MFC forum.
I doubt that pre-compiled headers support may have anything to do with this error. I would look for different compilation switches on files in project. Perhaps the same dev have set some compiler options of each file.
Pre-compiled headers definitely have something to do with this design bug.
To reproduce it, you have to turn off pre-compiled headers (the world is just simply bigger than the stdafx.h hack!), use static libraries, and then link in an extra library such as opengl32.lib.
This triggers the problem in both VC6 and VC8.
The work-around for VC8 (Visual Studio 2005) is:
1. Project -> Properties
2. Set Configuration = Debug
3. Select Configuration Properties -> Linker -> Input
4. Ignore Specific Library = uafxcwd.lib
5. Additional Dependencies = uafxcwd.lib (plus any add-on libraries such as version.lib or boost___.lib)
6. Set Configuration = Release
7. Select Configuration Properties -> Linker -> Input
8. Ignore Specific Library = uafxcw.lib
9. Additional Dependencies = uafxcw.lib (plus any add-on libraries such as version.lib or boost___.lib)
Hope this is helpful to many!
-Dan
You are probably aware that this problem also arises when trying to link .C files compiled as 'C' with an MFC app. I had a similar problem trying to link nafxcwd.lib and Libcmtd.lib. I previously fixed this for a VC6 project. (Basically, you are forcing the order in which the libraries are used by removing them from the list the linker thinks it needs and then manually add them back in.)
Having ported the project to VS2003, I knew what needed to be fixed but couldn't remember the steps.
Thanks for the instructions - it saves me having to experiment.
<a href= http://svipuoo.angelfire.com >cca catalog shopping</a> <a href= http://bkoszlj.angelfire.com >centruy 21 professional realty in hudson florida</a> <a href= http://etcighj.angelfire.com >automax dealership killeen</a> <a href= http://xdviqoc.angelfire.com >blue bells drawings and sketches</a> <a href= http://jdmmsok.angelfire.com >bridgewaters seaport</a>
PingBack from http://workfromhomecareer.info/story.php?id=16846
PingBack from http://lowcostcarinsurances.info/story.php?id=4908