Sign in to follow this  
AlexNHS

Getting a program to compile so that it is NOT using .Net

Recommended Posts

I have written a few small programs in C++ using Microsoft Visual Studio 2005. Everything always runs fine on my computer and the computers of anyone who has .Net 2.0 installed, but I want the programs to compile without the need for .Net. I have googled it and searched the board but haven't foung anything yet. Thanks for your time.

Share this post


Link to post
Share on other sites
Don't create a managed project. Create a win32 application, or win32 console application project.

You might have additional problems, though, if you've built your application in Debug mode, and the other system doesn't have the debug runtime.

Yet another problem is that you DID build in Release mode, but you didn't deploy the VC8 runtime correctly. This is trickier if you've got the Express edition, but it can be done.

Share this post


Link to post
Share on other sites
That's the wierd thing though. I did create a win32 project, but it is only working on machines with .Net 2.0 installed.

Quote:
Original post by RDragon1Yet another problem is that you DID build in Release mode, but you didn't deploy the VC8 runtime correctly. This is trickier if you've got the Express edition, but it can be done.


Could you explain that? What would I need to do to check if that is what is causing the problems?

Share this post


Link to post
Share on other sites
People are reporting an error saying something along the lines of:

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

Share this post


Link to post
Share on other sites
Also, under your project properties > General, ensure that "Common Language Runtime support" is set to "No Common Language Runtime support"...

Share this post


Link to post
Share on other sites
Quote:
Original post by AlexNHS
People are reporting an error saying something along the lines of:

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


Yup, that sounds like a symptom of not having the runtime installed on their machine.

Are you using the express version of visual studio?

Share this post


Link to post
Share on other sites
Quote:
Original post by AlexNHS
Yeah, I checked that already. And no I'm not using the express version.


Excellent.

Then check here for the runtime installer:

\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86

In that directory, you should see a vcredist_x86.exe - run that on the other machines to install the runtime.

Share this post


Link to post
Share on other sites
In the "final product", you should create an installer for your application, and it should include the runtime in the installer, so it will install it automatically if the user doesn't have it.

Share this post


Link to post
Share on other sites
Shouldn't there just be a way to compile a program that doesn't need that though? I mean, all that what I have written right now does is makes a window that moves around the screen to test a windows wrapper class.

Share this post


Link to post
Share on other sites
Quote:
Original post by AlexNHS
Shouldn't there just be a way to compile a program that doesn't need that though? I mean, all that what I have written right now does is makes a window that moves around the screen to test a windows wrapper class.


You can, if you link statically to the runtime. Any libraries you link against would also have to be compiled to link statically to the runtime. It's preferable to just link dynamically and install the runtime on the user's computer.

Share this post


Link to post
Share on other sites
I should have mentioned...

If you create a new project, look under "Other Project Types" > "Setup and Deployment", and create a "Setup Project". You can use that project type to create an installer for your application, and it can bundle the dependency dll's and install them automatically. It's pretty slick.

Just remember you're not ever supposed to deploy the debug runtimes.

Share this post


Link to post
Share on other sites
Okay so you are saying that if I create an installer that way it will have an option to include the dependacy runtimes automatically? Or do I ahve to manually add them from somewhere?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this