[question] Cross-platform App Coding

First off, I know this is in the wrong place, if a mod can decide where it should go, feel free to enlighten me!

I have used a little C sharp to make a couple of toy apps but now I'd like to have a go at making some more simple programs, but I'd really like them to run on more than one platform. I've heard Java can do this, but are there other languages? Or could someone point me in the direction of good resources on this topic?

I've got a relatively basic understanding of objects and other programming malarky, so nothing too complex please, but if you think this is a bit too advanced for a n00b, feel free to say.

L.

#180887

There are lots of cross-platform languages, and you've already mentioned two - Java and C#.

Thanks to the Mono Project, we .Net developers can pretty much rest assured that our apps will work just fine (for a given value of fine, of course) on any major platform.

Ok, so it's not 1.0 yet, but it's bloody good, given that...

#180895

Whenever you feel that these Byte Code Interpreters (Java and .Net) don't

meet your needs (huge runtime, versionitis) you might consider real hard

programming in C++. There are a lot of cross platform libraries to ease

development of user interfaces, but the most advanced to date is Trolltech's QT Library,

that will allow for Windows, Unix/Linux (desktop and PDA) and Mac cross

platform development from a single source base.

Of course, there are a lot of things not portable at all, e.g. OLE Automation,

multimedia stuff etc, but for the most programs it delivers a consistent look

and feel on all three platforms. QT is free for open, paid for closed source target

software. I'm not sure about it but I heard that QT is a statical link so that the

final executable does not depend on external runtimes, libraries with the exception

of version independent msvcrt.dll on windows, glibc.o on Linux and Mac, thus

simplifying installation issues to Copy'n Run.

Note that the Linux KDE desktop is done with QT and has been seen running

under a CygWin tweaked Windows.

However, C++ and its QT flavoured MOC (Meta Object Compiler, used to attach

user interface events to C++ classes) is tough stuff for the beginner.

Another real compiler would be Delphi, whose source code compatible unix/linux

pendant Kylix can't yet produce binaries that would run on a Mac.

hth,

herd

#180903

There's several ways to do it..

C# with Mono

Java with Swing

Java with SWT (native look and feel on various platforms)

C++ with WxWidgets (native look and feel on various platforms and *free* -- better than Qt toolkit IMO)

C with GTK+ (not quite native look and feel in Windows, but quite similar with GTK-Wine)

Then, there are several bindings for several languages for GUI toolkits mencioned above.. Such as:

Python with WxPython (WxWidgets bindings)

OCaml with lablgtk2 (GTK+ 2.* bindings)

...

and so on and so forth.

#180906

Thanks for the input everyone. I'm currently looking at the Java with SWT and C++ with wxwidgets ideas because I like the idea of maintaining the native look and feel within apps.

#180990

Originally posted by Ludge@Jun 23 2004, 05:47 PM

Thanks for the input everyone. I'm currently looking at the Java with SWT and C++ with wxwidgets ideas because I like the idea of maintaining the native look and feel within apps.

Mono/.Net does that too :rolleyes:

And natively, no less :P

Oh, and with mono, you can "proper compile" to platform-dependant binaries, I think...

#181010

Aha! even better! I might not have to give up the little I've learned already

#181025

Originally posted by Stevie BM@Jun 23 2004, 06:23 PM

platform-dependant binaries, I think...

Yes, you can... :naughty:

BTW, Stevie: if you're looking to mono, we can chat about it... ;)

#181031

Python comes with TK, so you can build cross platform GUI apps out of the box. TK keeps a somewhat-native look and feel. You can tell the difference, but it integrates pretty well (better on Windows/OSX than Linux).

You can also look at PyGTK (http://www.pygtk.org/). It's the GUI I use, and it should run on Windows and Linux. It's not completely cross platform, but it's very nice.

Of course I'd recommend Python, but that would only be out of personal preference.

#181067

i hwould have to say that c++ does the job. it has a lot of cross-platform libraries available...and if you know C your whole game changes, what with pointers and stuff. its a powerful language!

#181079

well, I've decided that I'm aiming too high for the moment, I'm going to continue with just php for a while, and slowly learn c++ so that i can use Xcode. Thanks for the recommendations though, I've copied them to my HD for when I want to try again ;)

#181093

Just do some portable C/C++ code and use QT for your GUI ;)

siwu

#183864