Sign in to follow this  
Greig Hamilton

[Solved] Distributing VC++ Express programs

Recommended Posts

Greig Hamilton    181
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]

Share this post


Link to post
Share on other sites
Illco    928
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

Share this post


Link to post
Share on other sites
Greig Hamilton    181
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

Share this post


Link to post
Share on other sites
wfreliszka    100
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....

Share this post


Link to post
Share on other sites
DrEvil    1148
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.

Share this post


Link to post
Share on other sites
Greig Hamilton    181
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

Share this post


Link to post
Share on other sites
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 :/

Share this post


Link to post
Share on other sites
superpig    1825
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.

Share this post


Link to post
Share on other sites
wfreliszka    100
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??

Share this post


Link to post
Share on other sites
vic    122
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?

Share this post


Link to post
Share on other sites
Ainokea    435
Quote:
Original post by wfreliszka
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??


Needs to be made from w32, otherwise it will be compiled as a .NET executable.

Share this post


Link to post
Share on other sites
vic    122
hello,

my applications are all W32 projects and compiled as it..
ive been importing them since VS2003 but still it is w32 projects..
no .NET app

even if it was compiled as .net application i installed .NET 1.1 and 2.0 on my other computer and still i get the same error..
why?

thanks in advance

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