Solved

Converting from Visual C++ 6 to VisualStudio 2005

Posted on 2006-11-03
5
924 Views
Last Modified: 2013-12-03
Hello out there,

I converted a project in which MFC library used from Visual C++ 6.0 to VisualStudio 2005. MFC libraries are used as DLLs.
The produced exe file runs fine on the development machine and one other PC.
On other machines under WinXP I get a message that says something in german similar to "the program istn't installed correctly, please re-install".
On Windows 2000 I get the clear message that mfc80.dll is missing. After copying mfc80.dll and msvcr80.dll into the program's directory it says COREDLL.DLL not found. But this library is only for Windows CE and doesn't even exist on the machine where the program can run correctly...

Has anyone an idea?

When trying to link the project with statically MFC library, I get linker errors
>> unresolved external symbol __HUGE
because in one one file we use HUGE_VAL and
>> nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
>> nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc

In the linker I specified
as additional dependencies: opengl32.lib glu32.lib winmm.lib setupapi.lib
and as ignore libs:  libc.lib,libcmt.lib

Might be someone could tell me which libraries to link aditionally.

Thank you in advance
Alexander Seebacher from Germany
0
Comment
Question by:PYTHALAB
  • 3
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
Comment Utility
You need to install VC++ 8.0 runtime on destination computer. It can be found in VS directory:
Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe

If you make installation package using VS 2005 Setup project, add VC++ runtime as prerequisite.
0
 
LVL 1

Author Comment

by:PYTHALAB
Comment Utility
Thank you so far.

This solves the first half of my problem.
I run the vcredist_x86.exe installation on a test machine and afterwards our program could run there without complaints.

For delivering first small updates of our software our manager wants us to send only the .exe files with statically linked new MFC libraries without the additional MFC 8.0 installation.
So I still have to find out how now to link with static libraries.

Best Regards
Alexander Seebacher
0
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
When project is created, MFC can be statically linked by checking this option in ine of Wizard steps. For existing project, use Project Properties - Configuration Properties - General - Use of MFC parameter.
I am not sure that this solves the problem because program still needs VC++ Runtime library.
0
 
LVL 1

Author Comment

by:PYTHALAB
Comment Utility
That was what I did as the very first step when creating the "Static Release" configuration in Visual Studio 2005.
But when linking, I receive the errors mentioned above.
Originally I linked the same libraries that worked perfectly in the "StaticRelease" configuration of Visual C++ 6.0
0
 
LVL 1

Author Comment

by:PYTHALAB
Comment Utility
I accepted the answer that helped me to install the missing DLLs on target machines.

The problem of missing __argc and __argv symbols when statically linking the program is still ever present.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now