Handmade Hero » Forums » Code » Game distribution
BertP
Bert Proesmans
9 posts
#72 Game distribution
4 years, 9 months ago Edited by Bert Proesmans on Dec. 2, 2014, 1:15 p.m.

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

The only way that Bob can screw up is if Bob is just incompetent.
- Casey Muratori, Day 014
UplinkCoder
Stefan Koch
22 posts
#74 Game distribution
4 years, 9 months ago

My Quick tip would be : use mingw.
cmuratori
Casey Muratori
818 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
4 years, 9 months ago

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
BertP
Bert Proesmans
9 posts
#94 Game distribution
4 years, 9 months ago

Thank you for the replies.
I'm looking forward to hear your ideas about this Mr. Muratori! :D

The only way that Bob can screw up is if Bob is just incompetent.
- Casey Muratori, Day 014
jtilander
Jim Tilander
2 posts
#102 Game distribution
4 years, 9 months ago

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/