Handmade Hero»Forums»Code
Bert Proesmans
9 posts
#72
Game distribution
Edited by Bert Proesmans on
Hello

I have a question about distributing C programs:
What is the best way to guarantee that a compiled program will work on any other computer running the operating system it's compiled for?

I'm a computer science student and learned C/C++ while working in Visual Studio.
The programs i create use MSVC (dll) libraries and don't run on another computer. (they crash before launching)

Based on my knowledge i can come up with these solutions:

  • Do a static build.
    I don't know if that is possible while using the Visual Studio compiler.
  • Inspect the executable and try to collect the necessary libraries.
    Maybe there is software that does this automatically?

I hope someone with more programming experience can tell me what to do best and maybe evaluate my given options.

Thanks in advance,
Bert
Stefan Koch
22 posts
#74
Game distribution
My Quick tip would be : use mingw.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
#85
Game distribution
We will actually be covering this topic in the stream. There are a number of things you can do to increase your chances of working, and we'll do those, but of course, the only surefire way is to test :)

- Casey
Bert Proesmans
9 posts
#94
Game distribution
Thank you for the replies.
I'm looking forward to hear your ideas about this Mr. Muratori! :D
Jim Tilander
2 posts
Game distribution
One could consider not using the CRT at all ... (is that what Casey is going to do?)

Or compile with the WDK compiler and thunk object files, as described here:

http://kobyk.wordpress.com/2007/0...th-msvcrtdll-using-visual-c-2005/