[udm-users] UDM Interpreter wizard issues

Brandon Eames beames at engineering.usu.edu
Thu Mar 23 12:01:28 CST 2006


Hi All,

I have resolved the linking problem.

The problem is described in Microsoft's Knowledge Base, article Q148652
The reason for the error is that the project must link against the MFC
library before the C runtime library.  This is the default for any file
which includes the stdafx header file, as long as that source file
includes stdafx.h before any other header file.  However, the
UDM-generated .cpp file (correctly) doesn't include stdafx.h.  So, the
solution is to either by-hand insert the stdafx.h file in that file, or
to hack the linker settings to exclude the (in my case) MFC and CRT
libraries by default, then specify their inclusion in the proper order.


Thus, I had to change my settings as follows:
Project properties, Debug configuration, Input tab, Ignore Specific
Libraries property: I put in the following: mfcs71d.lib msvcrtd.lib
Then, in the Additional Dependencies property on the same page, I put in
mfcs71d.lib msvcrtd.lib.

The linker will resolve these libraries in the order that that property
specifies, so the linker error is thus resolved.

Thanks,
Brandon.

--------------------------------------------
Brandon Eames, PhD
Assistant Professor
Electrical & Computer Engineering
Utah State University
Phone: (435) 797-2841


> -----Original Message-----
> From: udm-users-bounces at list.isis.vanderbilt.edu [mailto:udm-users-
> bounces at list.isis.vanderbilt.edu] On Behalf Of Brandon Eames
> Sent: Thursday, March 23, 2006 11:15 AM
> To: A list for UDM users to share thoughts, bugs and fixes
> Subject: RE: [udm-users] UDM Interpreter wizard issues
> 
> Hi Daniel,
> 
> I agree that it's probably an inconsistency between different runtime
> libraries that I'm linking against, but I'm not sure what setting is
> incorrect.
> 
> I have the Runtime Library property (C/C++ Code Generation...) set to
> Debug Multithreaded DLL for the Debug build, I'm not using ATL, and my
> project is set to use MFC in a shared DLL.
> 
> 
> Thanks,
> Brandon.
> 
> >
> > Hi Brandon,
> >
> > Which runtime library are linking with?  It sounds like some sort of
> > inconsistent linkage.  Are you using MFC and ATL?  If so, make sure
> you
> > are dynamically linking to both (Properties > C/C++ > General), and
> make
> > sure you are linking with the Multi-threaded DLL Runtime Library
> > (Properties > C/C++ > Code Generation).
> >
> > Hope this helps,
> > Daniel
> >
> >
> > -----Original Message-----
> > From:	udm-users-bounces at list.isis.vanderbilt.edu on behalf of
> Brandon
> > Eames
> > Sent:	Wed 3/22/2006 7:35 PM
> > To:	udm-users
> > Cc:
> > Subject:	[udm-users] UDM Interpreter wizard issues
> >
> > Hi All,
> >
> > I'm using the UDM interpreter wizard to generate a UDM interpreter
> > shell.
> >
> > I have successfully generated the visual studio project by manually
> > invoking mpc.  I have loaded the resulting project and built the
> > interpreter, registered it and run it by invoking it via GME.
> >
> > The problem arises when I attempt to clean the project.  When I
> execute
> > a Clean, or a Rebuild Solution, the build fails in the link stage,
> > stating the following error:
> >
> > mfcs71.lib(dllmodul.obj) : error LNK2005: _DllMain at 12 already
defined
> in
> > MSVCRT.lib(dllmain.obj)
> >
> > Once I clean the project, I can't get it to build in Debug or
Release.
> > Any suggestions as to why this is happening?
> >
> > (GME 5.9.21, UDM 3.0, Visual Studio 7.1)
> >
> > Thanks,
> > Brandon.
> >
> > --------------------------------------------
> > Brandon Eames, PhD
> > Assistant Professor
> > Electrical & Computer Engineering
> > Utah State University
> > Phone: (435) 797-2841
> >
> >
> > _______________________________________________
> > udm-users mailing list
> > udm-users at list.isis.vanderbilt.edu
> > http://list.isis.vanderbilt.edu/mailman/listinfo/udm-users
> >
> >
> >
> > _______________________________________________
> > udm-users mailing list
> > udm-users at list.isis.vanderbilt.edu
> > http://list.isis.vanderbilt.edu/mailman/listinfo/udm-users
> _______________________________________________
> udm-users mailing list
> udm-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/udm-users


More information about the udm-users mailing list