[Solved] Distributing VC++ Express programs

Started by
11 comments, last by vic 17 years, 11 months ago
I've written a simple C program using Visual Studio C++ Express (the free one). The program works fine on my computer running Visual Studio Express. If I move the program to another directory I need to copy the following files but at least it works. TicTacToe.exe TicTacToe.exe.manifest msvcr80d.dll alld42.dll But when I copy these files to another computer that isn't running VC Express it fails to run and gives me the following error. "The application has failed to start because the application is incorrect. Reinstalling the application may fix this problem." Reinstalling does not fix the problem. The problem computer is running a clean install of Windows XP Pro Version 2002 SP2. It has Windows Installer 3.1 installed (if this is relevant). Does anyone know why I am getting this very vague error message? Alternatively does anyone know how I can package up all the files into an installer type file. Reading the documentation it appears there is a program called mage.exe which does this but the Express version doesn't seem to contain this exe. The program doesn't do anything fancy, it's plain C code and only uses allegro. Greig [Edited by - Greig Hamilton on April 25, 2006 7:53:43 AM]
Advertisement
Judging from the 'd' postfixes on the required DLLs, your program has been built in debug configuration. While this is very useful for you as a developer, it requires different DLLs which a normal computer does not have. You should build your application in the release configuration.

(Project --> Configuration --> Release)

I don't know if you must also distribute some allegro-related DLLs but this could be the case.

I've also encountered ordinary non-managed programs still requiring .NET framework installation so this is something you might want to check as well.

Lately I heard that VC comes with an installation project through which you can build an end-user installer but I have nver tried this.

Illco
Solved.

After another check I realised the the .NET framework was not installed on the second PC. After installing this the program worked. :-) I thought I had checked it but I guess not.

Greig
Is your program in NET C++??? Are you using NET libraries???? Why .NET framework is needed????

You write that program is in C...

I readed in book that NET c++ is also compiled to byte code. But there is also way to write program compiled to specified platform....
Also you can avoid needing to redistribute msvcr80*.dll if you go into project properties, c/c++, code generation, and change to multi-threaded (for release), and multi-threaded debug (for debug). By default I believe things are set to multi-threaded dll, which dynamically links to the msvcr80*.dlls. Changing it to just multi-threaded will statically link, increasing the exe size a bit but eliminating dependencies such as that dll.
DrEvil:
Thanks for that tip, I sorted that issue out at the same time as fixing this one.
Now all I need to distribute is the exe file and the allegro dll. Oh and the .NET framework if the user doesn't have that.

wfreliszka:
My understanding is that all programs compiled with Visual Studio Express are .NET even if your own code doesn't use .NET. At least that's my understanding, someone else may want to expand on this and correct me if I'm wrong.

Greig

Quote:Original post by IllcoLately I heard that VC comes with an installation project through which you can build an end-user installer but I have nver tried this.

Illco


You should, it's very usful and extremly powerful. Watch out for making MSIs for mobile apps though, that can be a bit tricky :/
Quote:Original post by Greig Hamilton
wfreliszka:
My understanding is that all programs compiled with Visual Studio Express are .NET even if your own code doesn't use .NET. At least that's my understanding, someone else may want to expand on this and correct me if I'm wrong.


No, I'm fairly sure you can create Native (non-.NET) apps with Visual Studio Express. What I suspect has happened is that your program is actually in C++, but written in such a way that it looks like C.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

I used non express edition a little vs8. (I stick to vs7) And you can create MFC and W32 and they are native not NET. No NET platform is needed. Did you create project for NET? or W32?

Only Win32 can be native from my knowledge. Am I right??
hello there..
im having the same problem with a app i built

im using my own 3d library (DLL) and my app works just fine on my pc
but if i put it someother pc it gives me that error

the only files needed for it to run is my 3d library dll file and the data..

i installed framework 1.1 and 2.0. also compiled using multithreaded app
i also tried debug and release builds.. still nothing..

any other idea?

This topic is closed to new replies.

Advertisement