PDA

View Full Version : Developing for OS X and Windows?




ogee
Mar 31, 2007, 10:55 PM
If I create an application using Cocoa and Xcode on my Mac, can I also generate a windows exe from the same code?

i.e. Is cross platform development feasible in this environment?

I use Mac at home, but work is Windows only. I have a couple of windows app I wrote for XP and have to rewrite and I would love to do it on my mac and cross compile. One is a time management utility for shift workers, the other is a specialised utility to check satellite parameters and calculate various factors.



Soulstorm
Apr 1, 2007, 02:24 AM
If I create an application using Cocoa and Xcode on my Mac, can I also generate a windows exe from the same code?

i.e. Is cross platform development feasible in this environment?

I use Mac at home, but work is Windows only. I have a couple of windows app I wrote for XP and have to rewrite and I would love to do it on my mac and cross compile. One is a time management utility for shift workers, the other is a specialised utility to check satellite parameters and calculate various factors.

Cocoa applications cannot be ported directly on PC's. Unfortunately, you must write some platform specific code in order for it to work.

My advice is try to keep the important program functions cross-platform. That way, the only thing that will change during the porting process is the GUI code.

However, you should try GNUSTEP (http://www.gnustep.org/). I haven't used it, but it seems it has some similar functions with Cocoa.

grabberslasher
Apr 1, 2007, 01:59 PM
You can compile Windows applications with the command line by installing MinGW:

http://crossgcc.rts-software.org/doku.php?id=start

However, I cannot suggest an easy way to use it with Xcode, I personally use makefiles in my crosscompiling Xcode projects when I want to target Windows, Linux or iPod Linux.

cblackburn
Apr 2, 2007, 05:13 AM
Hey,

If you are developing cross platform from the outset, rather than porting a previous program then I would reccomend using a cross platform toolkit rather then Cocoa.

You can co down the Java route but I personally hate the language and no matter what anyone says it will never be as fast at a natively compiled language.

There is also a cross platform GUI toolkit called wxWidgets (http://www.wxwidgets.org/). This will let you recompile your program onto Windows, MacOS X and Linux with little or no reworking required. It also runs on a variety of languages like C++ and Perl and many more.

Chris.

tutubibi
Apr 2, 2007, 12:05 PM
Another vote for wxWidgets.

However, there are other options like QT (http://www.trolltech.com/) that is very mature framework supporting Windows, OS X and Linux (KDE is written on top of QT). Another alternative is GTK (http://www.gtk.org/) (OSX project is hosted on sourceforge (http://sourceforge.net/projects/gtk-osx/) page but not really updated recently). For simpler apps, maybe even Tck/Tk is an option.

And as previous posters already mentioned, there is Java too.

Depending on the requirements you may also consider web-based application.

caveman_uk
Apr 2, 2007, 04:18 PM
However, there are other options like QT (http://www.trolltech.com/) that is very mature framework supporting Windows, OS X and Linux (KDE is written on top of QT).
QT is nice but it's not free...in fact it's rather expensive if you're not doing open-source work. Check the licensing terms before you start using it.

findhornriver
Apr 2, 2007, 04:37 PM
wxPython is the easiest cross platform language/framework you'll find. It runs on Mac OSX (Universal), Linux and Windows and is very mature.

Because its framework is wxWidgets (built in to wxPython by the way - you don't need to load wxwidgets) the look and feel of the application is native to the paltform it is run on.

It'll make an app for osx and an exe for windows using py2app and py2exe so the end-user doesn't even need to have loaded python or anything else. It just runs.

It's free, so give it a try.

http://wiki.wxpython.org/index.cgi/wxPython

ogee
Apr 2, 2007, 07:48 PM
Thanks that gives me a few ideas to look into.

Any idea how companies like Adobe work on such projects, e.g. CS3 etc. I would assume they use a common code base?

Aniej
Apr 3, 2007, 03:06 AM
what languages are most commonly used for creating web based applications? Even though they are web based, would I still need to take into account cross-platform issues? I would assume yes to some degree for the same reason that safari does not work with certain features on some sites.

ATG
Apr 3, 2007, 04:23 AM
Thanks that gives me a few ideas to look into.

Any idea how companies like Adobe work on such projects, e.g. CS3 etc. I would assume they use a common code base?
Adobe use QT and C++ if I am not mistaken.