C++ debug compiler errors

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to compile my C++ programs in debug mode in Visual NET 2003 and keep getting the following message
fatal error LNK1104: cannot open file 'mfc70d.lib
I cannot find this program anywhere in my Windows 2003 Server operating system. Also, I cannot find MFC42D.DLL anywhere in the system. How can I test in debug mode without it? What is causing these errors and how do I get around it
Dave Uphof
 
Dave said:
I am trying to compile my C++ programs in debug mode in Visual NET 2003 and keep getting the following message:
fatal error LNK1104: cannot open file 'mfc70d.lib'
I cannot find this program anywhere in my Windows 2003 Server operating system. Also, I cannot find MFC42D.DLL anywhere in the system. How can I test in debug mode without it? What is causing these errors and how do I get around it?
Dave Uphoff

Was this program initially compiled using VC++7.0? You say you're using
..NET 2003 so that means it should be linking with mfc71d.lib. If you
were using VC++7.0 then trying to link with mc70d.lib makes sense. If
you're using 7.1 then goto the project settings->linker->input and look
for the file mfc70.lib and change it to mfc71.lib.
 
Sashan
Thanks for your reply. My program was originally compiled with Visual C++ 6.0, then 7.0 with NET 2002 and now 7.1 with NET 2003. I don't see any reference to mfc70.lib in the Input section for the linker properties. How do I change something I can't find? Can I just add mfc71.lib to my list of linker inputs? For some reason the compiler thinks I am compiling with 7.0 when I am actually using 7.1.
Dave
 
Dave said:
Sashan;
Thanks for your reply. My program was originally compiled with Visual C++ 6.0, then 7.0 with NET 2002 and now 7.1 with NET 2003. I don't see any reference to mfc70.lib in the Input section for the linker properties. How do I change something I can't find? Can I just add mfc71.lib to my list of linker inputs? For some reason the compiler thinks I am compiling with 7.0 when I am actually using 7.1.
Dave

Well I'm confused as well. I don't think adding mfc71d.lib to the list
of inputs will help though, since the linker will still look for
mfc70d.lib. Check the command line passed to the linker (project
settings->linker->command line). Maybe mfc70d.lib is mentioned there.
 
C++ 6.0, then 7.0 with NET 2002 and now 7.1 with NET 2003. I don't see any
reference to mfc70.lib in the Input section for the linker properties. How
do I change something I can't find? Can I just add mfc71.lib to my list of
linker inputs? For some reason the compiler thinks I am compiling with 7.0
when I am actually using 7.1.
Well I'm confused as well. I don't think adding mfc71d.lib to the list
of inputs will help though, since the linker will still look for
mfc70d.lib. Check the command line passed to the linker (project
settings->linker->command line). Maybe mfc70d.lib is mentioned there.

I'm confused by the overall issue of mismatched versions as well, but Afx.h
uses #pragma comment(lib, "") to embed the appropriate library search record
in the *.obj.
 
----- Jeff Partch [MVP] wrote: ----

[CUT
I'm confused by the overall issue of mismatched versions as well, but Afx.
uses #pragma comment(lib, "") to embed the appropriate library search recor
in the *.obj

...And I think this will get you more confused:
I have the same problem and never installed .NET 2002 but only .NET 2003. I open afx.h and found this
#ifdef _DEBU
#pragma comment(lib, "mfc71d.lib"
#pragma comment(lib, "mfcs71d.lib"
#els
#pragma comment(lib, "mfc71.lib"
#pragma comment(lib, "mfcs71.lib"
#endi

Now I ask you: why does VC7 try to compile with mfc70.lib? I searched my disk for a file containing mfc70.lib and result in a "0 files found" message.
Regedit (just for a try) return no key/data/value on an mfc70 searc
Maybe something wrong in the .net 2003 italian version
My job is stopped for this reason and i've patched copying and renaming the mfc71.lib into mfc70.lib and things gone right but i don't like this
Thanks for attentio

ZaZy - D.P.E. Development Team
 
I have the same problem and never installed .NET 2002 but only .NET 2003. I open afx.h and found this:
#ifdef _DEBUG
#pragma comment(lib, "mfc71d.lib")
#pragma comment(lib, "mfcs71d.lib")
#else
#pragma comment(lib, "mfc71.lib")
#pragma comment(lib, "mfcs71.lib")
#endif

Now I ask you: why does VC7 try to compile with mfc70.lib? I searched my
disk for a file containing mfc70.lib and result in a "0 files found"
message.
Regedit (just for a try) return no key/data/value on an mfc70 search
Maybe something wrong in the .net 2003 italian version?
My job is stopped for this reason and i've patched copying and renaming
the mfc71.lib into mfc70.lib and things gone right but i don't like
this!

You included in your project an obj file or a lib file which was
compiled with .NET 2002. Object files contain records that tell the
linker which files to look for.

Jeff Bean
CWC Software
 
Back
Top