Porting MFC from vc6 to vc7 
Author Message
 Porting MFC from vc6 to vc7

Hi

I have an ATL VC6.0 project that supports MFC. I let VC7 port it and
create a .vcproj for me. When I attempt to build it I fail during
linking and get:
LINK : fatal error LNK1104: cannot open file mfc42d.lib.

Why is the linker looking for the MFC42 libraries? How do I tell it to
link with the version 7 libraries?

Adam



Fri, 05 Mar 2004 19:12:53 GMT  
 Porting MFC from vc6 to vc7
One of two things is likely happening:

In the linker options, mfc42d.lib is explicitly specified at an Input
library
-or-
The MFC 4.2 headers are in your path before the MFC 7 headers.

In the first case, remove any references to mfc42*.lib from your linker
options. If you're building in the IDE, go to the Solution Explorer,
right-click on your project and choose Properties. Select the Linker folder
on the left and then the Input item in that folder and see if mfc42*.lib is
specified there. In your case, make sure you have the Debug configuration
specified...might as well check Release as well. Otherwise pull it from your
makefile. This lib is actually specified in the header files so you don't
need to specifically add it to your makefile.

The second case may be true because there is a #pragma in the header file
specifying the MFC lib. This is called a "defaul lib" and is what the /NOD
linker switch ignores. To rule this problem out, you just need to look at
the directories specified in the IDE, in your makefile, or in your system
environment variables to make sure that the old MFC directories are out of
the picture. To check the IDE settings, select Options from the Tools menu,
choose the Projects folder and you'll see the directories.

Later,

Walter Sullivan
Lead Program Manager, ATL/MFC



Quote:
> Hi

> I have an ATL VC6.0 project that supports MFC. I let VC7 port it and
> create a .vcproj for me. When I attempt to build it I fail during
> linking and get:
> LINK : fatal error LNK1104: cannot open file mfc42d.lib.

> Why is the linker looking for the MFC42 libraries? How do I tell it to
> link with the version 7 libraries?

> Adam



Sat, 06 Mar 2004 10:16:41 GMT  
 Porting MFC from vc6 to vc7
Or a third thing that might be happening is that you're linking to a static
library that was compiled to link against mfc42.lib, which I believe the
only workaround would be to get a new version of the static lib that links
to mfc70.lib.

- Elton



Quote:
> One of two things is likely happening:

> In the linker options, mfc42d.lib is explicitly specified at an Input
> library
> -or-
> The MFC 4.2 headers are in your path before the MFC 7 headers.

> In the first case, remove any references to mfc42*.lib from your linker
> options. If you're building in the IDE, go to the Solution Explorer,
> right-click on your project and choose Properties. Select the Linker
folder
> on the left and then the Input item in that folder and see if mfc42*.lib
is
> specified there. In your case, make sure you have the Debug configuration
> specified...might as well check Release as well. Otherwise pull it from
your
> makefile. This lib is actually specified in the header files so you don't
> need to specifically add it to your makefile.

> The second case may be true because there is a #pragma in the header file
> specifying the MFC lib. This is called a "defaul lib" and is what the /NOD
> linker switch ignores. To rule this problem out, you just need to look at
> the directories specified in the IDE, in your makefile, or in your system
> environment variables to make sure that the old MFC directories are out of
> the picture. To check the IDE settings, select Options from the Tools
menu,
> choose the Projects folder and you'll see the directories.

> Later,

> Walter Sullivan
> Lead Program Manager, ATL/MFC



> > Hi

> > I have an ATL VC6.0 project that supports MFC. I let VC7 port it and
> > create a .vcproj for me. When I attempt to build it I fail during
> > linking and get:
> > LINK : fatal error LNK1104: cannot open file mfc42d.lib.

> > Why is the linker looking for the MFC42 libraries? How do I tell it to
> > link with the version 7 libraries?

> > Adam



Sun, 07 Mar 2004 07:07:31 GMT  
 Porting MFC from vc6 to vc7
Thank you all for your ideas. As I am on vacation until mid October I
will not be able to check what is going wrong till then. All I managed
to do before I left is to verify that mfc42 is not mentioned anywhere
in the .vcproj file.

Later...

Adam

Quote:

> Or a third thing that might be happening is that you're linking to a static
> library that was compiled to link against mfc42.lib, which I believe the
> only workaround would be to get a new version of the static lib that links
> to mfc70.lib.

> - Elton



> > One of two things is likely happening:

> > In the linker options, mfc42d.lib is explicitly specified at an Input
> > library
> > -or-
> > The MFC 4.2 headers are in your path before the MFC 7 headers.

> > In the first case, remove any references to mfc42*.lib from your linker
> > options. If you're building in the IDE, go to the Solution Explorer,
> > right-click on your project and choose Properties. Select the Linker
>  folder
> > on the left and then the Input item in that folder and see if mfc42*.lib
>  is
> > specified there. In your case, make sure you have the Debug configuration
> > specified...might as well check Release as well. Otherwise pull it from
>  your
> > makefile. This lib is actually specified in the header files so you don't
> > need to specifically add it to your makefile.

> > The second case may be true because there is a #pragma in the header file
> > specifying the MFC lib. This is called a "defaul lib" and is what the /NOD
> > linker switch ignores. To rule this problem out, you just need to look at
> > the directories specified in the IDE, in your makefile, or in your system
> > environment variables to make sure that the old MFC directories are out of
> > the picture. To check the IDE settings, select Options from the Tools
>  menu,
> > choose the Projects folder and you'll see the directories.

> > Later,

> > Walter Sullivan
> > Lead Program Manager, ATL/MFC



> > > Hi

> > > I have an ATL VC6.0 project that supports MFC. I let VC7 port it and
> > > create a .vcproj for me. When I attempt to build it I fail during
> > > linking and get:
> > > LINK : fatal error LNK1104: cannot open file mfc42d.lib.

> > > Why is the linker looking for the MFC42 libraries? How do I tell it to
> > > link with the version 7 libraries?

> > > Adam



Mon, 15 Mar 2004 12:03:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ASSERT in CString::Mid() when porting from VC6 to VC7

2. CControlBar::m_bAutoDelete=TRUE causes shutdown crash porting from VC6 to VC7

3. access violation due to bad CString copy ctor when porting from VC6 to VC7 (VC++.NET)

4. Problem while porting VC6 to VC7

5. Porting from VC6.0 to VC7.0

6. ASSERT in CString::Mid() when porting from VC6 to VC7

7. CControlBar::m_bAutoDelete=TRUE causes shutdown crash porting from VC6 to VC7

8. Porting Problem from VC6 to VC7

9. problem porting vc6 mfc app in .net

10. possible bug in VC6, VC7, VC7.1

11. VC6 to VC7 migration problem (problem with ATL and MFC)

12. VC7 calling VC6 MFC DLL

 

 
Powered by phpBB® Forum Software