Re: [Gtk-osx-users] Question about programs portability

On Apr 24, 2011, at 8:10 AM, Tommaso Ricci wrote:

> I have a question about gtk, i'm a new programmer and i'm in trouble with the gtk portability..
> My question is: to run my gtk compiled application written in c my computer must have gtk installed??? For example if i give my mac-compiled app to a friend that as the same mac will he be able to run that?

Well, on OSX you include Gtk (and all of the other libraries that your application requires) in the application bundle. MS Windows users will need to install those libraries, so for that platform you'll use an installer program. On Linux the user will have to install Gtk+ and the other dependencies via the package manager if she doesn't already have them installed. This is equally true of all cross-platform frameworks.

As I've written in the wiki, though, Gtk+ is not a good choice for new work if cross-platform portability is important to you. Although much improved over the last two years, Gtk+ remains primarily a Unix toolkit that happens (through a lot of hard work by nowhere near enough people) to compile and run on OSX and MS Windows. Qt and wxWidgets, which are designed and built with the primary goal of being cross-platform, are much better toolkits. 

Since you're new to programming, I suggest that you avoid Gtk+ for another reason: It's weird. The underlying premise is that it's possible, and therefore desirable, to write object-oriented code in pure C. Well, it is possible, but it's a bad idea, and you will learn all manner of very bad habits from taking that path. Instead, learn Python or Java, learn how to decompose problems into objects, and learn how to separate your application into models, views, and controllers. After you've practiced that for a few years you can come back to C/C++/ObjectiveC if you want to, and you'll be on much firmer ground for learning to use them well.

If you want to continue this conversation, you'll need to join the list. The URL is tacked on at the bottom of each message after Sourceforge's ad.

John Ralls

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]