The 2024 Wheel Reinvention Jam is happening now. September 23-29, 2024. More info

Game distribution

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

Edited by Bert Proesmans on
My Quick tip would be : use mingw.
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
Thank you for the replies.
I'm looking forward to hear your ideas about this Mr. Muratori! :D
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/