Page 1 of 1

Distributing binary files

Posted: Wed Feb 21, 2007 6:58 pm
by ecoonradt
Hello,

I'm relatively new to wxWidgets, but I've managed to put together a very simple application that simulates the dice game CeeLo. http://bingweb.binghamton.edu/~ecoonra1

It works great when I compile it on each machine that I want to run it on, but in both linux and windows when I manually move the compiled binary file to another machine running the same OS it (usually) does not run.

I'm using wxWidgets 2.8.0 with MS Visual Studio 2005 on Windows, and g++ on linux. I imagine (at least for windows) that VS is including some DLLs that are unique to my system, and therefore the program won't run anywhere else.

I'd like to know how to be able to compile once and run anywhere. Are there possibly compiler or linker options that I can change in VS to make this work? Or is there some way to determine what DLLs a program requires so I can distribute them with the compiled exe?

Thanks

Posted: Wed Feb 21, 2007 7:02 pm
by Auria
Habve you build wxWidgets as static? For distribtuing a single app, it makes things easier (even though on Linux it's always tricky from distro to distro)

Re: Distributing binary files

Posted: Wed Feb 21, 2007 10:35 pm
by tierra
ecoonradt wrote:I'm using wxWidgets 2.8.0 with MS Visual Studio 2005 on Windows, and g++ on linux. I imagine (at least for windows) that VS is including some DLLs that are unique to my system, and therefore the program won't run anywhere else.
This is usually the case, and most often happens with whatever version of the C++ Runtime Library you are using, but Visual Studio usually includes a permissive license for redistributing most of the more commonly used libraries.
ecoonradt wrote:I'd like to know how to be able to compile once and run anywhere. Are there possibly compiler or linker options that I can change in VS to make this work? Or is there some way to determine what DLLs a program requires so I can distribute them with the compiled exe?
There isn't really any compiler options that do anything in this regard, it's more of just knowing which libraries you're linking statically, which you're distributing as shared libraries, and knowing/checking version numbers on any libraries you add dependencies for that you don't redistribute (mostly an issue on linux systems where it's near impossible to link to GTK+ statically, and you shouldn't really be distributing your own version either). wxWidgets has checks in place for supporting different versions of GTK+, so that issue shouldn't get in the way much.