Porting Code (e.g. Java)

Haggis McHaggis
Post: #1
Hey, I'm new to Mac programming generally so pardon any stupidness and feel free to patronise as much as possible.

I was just wondering if porting windows based code (e.g. visual studio) can be done relatively easily? I realise it requires different libraries or whatever, but are there any standards that allow code to be moved from one platform to another?

I ask particularily as I'm coding in Java at the minute, using rubbish JCreator to compile it, and it would be great if the content could be copied and pasted to the nicer developer tool? Like open a Java project and include the Java files. Obviously it would steer clear of the interface builder but just give me the ability to work at home.

Any help appreciated.
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
Java and most of its libraries are cross-platform. The same can't be said of many/most C++ libraries.

If you've got a Java app using Swing or the AWT for windowing, it should probably work just fine compiled by Project Builder (javac or jikes).
Quote this message in a reply
Posts: 370
Joined: 2002.04
Post: #3
You should be able to copy and paste the code, but make sure that you use the Java Tool template, as you don't want to use the Cocoa libraries.

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Post: #4
Sort of a reiteration of OSC's post, Java use a virtual machine that doesn't *need* porting to other platforms once you find the way you're using to run the program -- being a student, that's usually with Terminal Rasp
All you really need to make Java code work is Project Builder and the Terminal. Then you're off.

C++ code ... you should realy "#if 0" your Library-specific lines and gradually introduce each library to see which ones are supported, but expect to rewrite a lot of the preprocessed-out code. Especially w/ VS C++, which I had the misfortune of using. Gaaaahhh.... MS needs to work on their compiler.
IMO, you haven't seen preprocessor spagetti until you try making a crossplat program with all variations in the same source files.

-"Sta7ic" Matt
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Help porting Puyo Puyo from Code warrior 8 to xcode unknown 7 7,175 Nov 14, 2005 05:04 AM
Last Post: unknown
  porting linux glut code to mac os x zynek 12 10,006 Jan 23, 2005 05:47 PM
Last Post: zynek