How to publish Visual C++ work in OpenGL

Recently I have created some simple games using OpenGL in Visual C++.
Now I want to run the “.exe” file in other computers also. How do I do that?
If I copy the complete debug folder in my project directory along with glut32.dll file, then the “.exe” file requires Visual C++ 2005 to run in that computer.
How can I generate a single file or a set of files which can let my application run in any other computer without installing Visual C++.

As far as I understand it, unless you have purchased the full license for Visual C++ then you have a limited publishing ability. If you want a completely stand-alone version of your program you have to have that license to compile it. (Microsoft’s way of getting more money from you to make published work.) The Express versions (Visual C++ Express) last time I used them did not include the capability to compile stand-alone applications.

I used to use Visual Studio and I had to bundle the .net framework with all applications I wrote and there was no way around it other than above.

However, that was a long time ago and things may have changed or maybe you have the full version. In that case I believe there is an option somewhere to compile it, for example, as a release version instead of a debug version.

If I copy the complete debug folder in my project directory along with glut32.dll file, then the “.exe” file requires Visual C++ 2005 to run in that computer.

Of course it does. Only people with Visual Studio installed have debug libraries. Which the debug version of your executable relies on.

That’s why you shouldn’t be publishing debug executables. Build for release and try publishing that.

I used to use Visual Studio and I had to bundle the .net framework with all applications I wrote and there was no way around it other than above.

Of course you did. It’s a .NET application; by definition, it relies on .NET. So if your users don’t have .NET, they must install it.

“Any other computer” is a tall order. I’m assuming you’re compiling on a Windows 32 bit machine, in which case a reasonable goal would be to get your app running on other Windows computers. I do this all the time. I suggest you compile a release version with the .exe file in the same folder as the source code (not the debug folder). That folder should also contain any files that are needed for input, such as images you might be using for texture maps. I’ve also found that the MSVCRT.dll has to be included for people who don’t have Visual Studio. But that’s it. Your users do not have to have a compiler to run your code. What I do is put copies of all the files required to run the app into a separate folder. Sometimes that means 4 files. Sometimes it means 100 files. First see if you can run your app from that ‘test’ folder. If that works, zip the folder up, put it on a flash drive, take it to another Windows computer, unzip it, and double click on the .exe. I usually find that I’ve forgotten some input file that’s necessary to run the app. After 2 or 3 tries, you’ll be making zip files that you can email out. The advantage of zipping is that you can distribute your app as one file. Everybody has unzipping utilities on their Windows computers (I think).

Hey guys,

Thank you very much for your consideration. My problem has been solved out. I was compiling my code in debug mode and that was the fault. I compiled my code in release mode and the file is transferable now. Yeah I mean any 32 bit windows system is capable of running that file without need of any compilation.

One more thing I found out that if I compile my code using Dev C++, the things get simple. It creates “.exe” file while is a stand alone file i.e. it does not even require the necessary dll files. May it keeps a copy of those files within it.

Thank you

This is completely untrue: http://www.microsoft.com/express/Support/Support-faq.aspx

Can I use Express Editions for commercial use?
Yes, there are no licensing restrictions for applications built using Visual Studio Express Editions.

Aside from the debug vs release build matter, you may also want to link to the static library version of the C++ runtime (rather than the DLL version).

This is completely untrue: http://www.microsoft.com/express/Support/Support-faq.aspx

Can I use Express Editions for commercial use?
Yes, there are no licensing restrictions for applications built using Visual Studio Express Editions.

Aside from the debug vs release build matter, you may also want to link to the static library version of the C++ runtime (rather than the DLL version). [/QUOTE]

I stand corrected, though I am fairly certain that in the “past” you could not use it commercially. They must have changed that. I apologize for the misinformation.

In fairness, there was once a “Learner” (or it may have been “Student”) edition of Visual Studio to which such a restriction did apply, and which may be the one you’re thinking of. Express has always been unencumbered.

Thats very possible, as I first used it in a version I obtained from a C++ course.