Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ogee

macrumors 6502
Original poster
Nov 8, 2006
417
0
Earth.
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

macrumors 68000
Feb 1, 2005
1,887
1
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. I haven't used it, but it seems it has some similar functions with Cocoa.
 

cblackburn

macrumors regular
Jul 5, 2005
158
0
London, UK
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

macrumors 6502a
Sep 18, 2003
577
81
localhost
Another vote for wxWidgets.

However, there are other options like QT that is very mature framework supporting Windows, OS X and Linux (KDE is written on top of QT). Another alternative is GTK (OSX project is hosted on sourceforge 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.
 

findhornriver

macrumors newbie
Oct 1, 2006
16
0
Maine
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

macrumors 6502
Original poster
Nov 8, 2006
417
0
Earth.
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

macrumors 68000
Oct 17, 2006
1,743
0
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

macrumors regular
Aug 7, 2005
187
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.