?
Solved

Deploy without MSVCR80.DLL.

Posted on 2006-06-07
16
Medium Priority
?
8,382 Views
Last Modified: 2010-07-27
All,

I've written a C/C++  console app in VS 2005. I need to be able to copy it to any Win32 PC without the MSVCR80.DLL and run it there. Are there any settings I can change to make this happen.

The code is raw C/C++ with only ANSI functions. There aren't even any Win32 system calls.

Is there any way I can remove its requirement of this pesky DLL?

My only other alternative is to build it under VC6 but I would prefer not to.

Paul
0
Comment
Question by:PaulCaswell
16 Comments
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 16858476
Make a release build of your application.
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16859513
I did!

When I run it on a normal Win32 PC it gives me:

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem"

Dependency Walker tells me it needs MSVCR80.DLL which is not installed on the target machine so I accept the message as true and valid because the documentation states that you need to install it.

However, I dont want to install it! I dont need it. I havent used any functionality that requires it. All I want to do is create a Win32 console app I can run on any Win32 PC, just like I can do with VC++6.

Thanks Rajeev.

Paul
0
 
LVL 10

Expert Comment

by:Eduard Ghergu
ID: 16860812
Hello!

The problem is in the project configuration.
Please, have a look in the Project>Configuration Properties>General>Project Defaults>Use of MFC. The value should be: Use Standard Windows Libraries
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 16

Author Comment

by:PaulCaswell
ID: 16862902
>>... Use Standard Windows Libraries
Already done! Still not working. :-(

Are there any new-project wizard options that will do this for me?

Paul
0
 
LVL 10

Expert Comment

by:Eduard Ghergu
ID: 16864008
Hello!

The wizards are available in comercial versions of VS 2005, but not in the Express Edition one...
Please, check also
Project>Configuration Properties>General>Project Defaults>Common Language Runtime Support
You should have the value
No Common Language Runtime support
for this option...
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16864130
Hi ghergu,

>>...comercial versions...
I have professional.

>>...No Common Language Runtime support
Already set.

Am I asking for something that VS2005 just cant do? I cant believe that everything built by VS2005 must use .NET technology.

Could someone create a simple Hello World console app and tell me if it runs on plain boring Win32?

Paul
0
 
LVL 10

Expert Comment

by:Eduard Ghergu
ID: 16864323
Hello!

If this option is already set the generated code is targeting Win32, not .NET... What error do you receive? Try to rebuild the solution.
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16864496
Dependency Walker fully expanded shows:

PROGRAM.EXE
--KERNEL32.DLL
--MSVCR80.DLL
----MSVCRT.DLL
-----*KERNEL32.DLL
-----*NTDLL.DLL
---*KERNEL32.DLL

Items marked '*' have the arrow suggesting an alias/pointer.

The error message is:

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem"

Research suggest that because MSVCR80 is present in the dependancy tree an attempt will be made to link it in at run-time. However, it contains nothing but links to existing DLLs. Its non-presence on the system should be a surmountable problem.

I would certainly appreciate a method of removing it completely. Could this be a 'link' option?

Paul

0
 
LVL 10

Assisted Solution

by:Eduard Ghergu
Eduard Ghergu earned 200 total points
ID: 16864580
Please, change again the value of
Project>Configuration Properties>General>Project Defaults>Use of MFC
to
Use MFC in a Static Library
and build the project

 
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16864759
I just created a brand new, empty console project, included all the files in the old project, changed 'Use Unicode' to 'Not Set' (I need ascii), built the project and it does the same thing. :-((

I'll try a 'Hello World' next.

Paul
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16864800
>>Use MFC in a Static Library
That worked! :-))

Unfortunately, the .exe has jumped from 76k to 560k. Is there a smaller step we can make that still achieves runnability?

Paul
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16864839
The 'Hello World', (actually, I didnt even add any code, I left it all defaulted) has the same problem!
0
 
LVL 10

Expert Comment

by:Eduard Ghergu
ID: 16867305
Hello!

You can keep it small, but not with VS2005 that is targeting .NET Framework development. You can try to use VS2003 or another win32 compiler
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16868192
So essentially, VS 2005 is worthless unless everything you plan to do is intended only to run in a .NET environment.

That makes me really annoyed!

Paul
0
 
LVL 3

Accepted Solution

by:
Mikeh926 earned 800 total points
ID: 16870176
Yes you can remove the dependency on the DLL and not end up with a huge exe...

Go back to your initial settings, whatever you get when you create a brand new win32 console app, so Use of MFC should be "Standard Windows Libaries", ATL should be "Not using ATL", etc...

Then, under project settings, C/C++, Code Generation, set Runtime Library to "Multi-Threaded (/MT)".  

This will import library code from the appropriate .lib file instead of linking with msvrv80.dll. On my quick hello world test app, I ended up with a 48KB console exe that did not depend on anything other than kernel32.dll.

Mike.
0
 
LVL 16

Author Comment

by:PaulCaswell
ID: 16870290
Mikeh926,

Awesome! That's done it! :-))

Now at 100k! Not bad, a 30% bloat, but it should be a constant so that is reasonable.

Paul
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

864 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