Thread: cross-platform issues

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    242

    cross-platform issues

    A friend of mine is learning C for Mac (he's a web-designer coming from graphics, hence has more of a Mac affinity), and I'm slowly getting further into C++ currently using MS Visual Studio Express as IDE on PC. So, I was wondering about a few things.

    First, is Cocoa basically the Apple version of the Microsoft .NET framework? That's kind of the way it seemed to me browsing around the various Wikipedia articles. It seems to support C fully but at least not to feature C++ prominently (although they do say something about Objective-C++ as an apparent way to write C++ for Mac).

    So, that line of thought got me looking at how you would compile a C++ program on a Mac at all, and the best info I came across was this Wikipedia chart, which in the C++ section shows what platforms are supported:

    Comparison of integrated development environments - Wikipedia, the free encyclopedia

    Of the IDEs I've heard of, GNAT Programming Studio is the only one I saw that seems to support Mac as well as Windows.

    So, my additional questions:
    1) What do you guys think of the GNAT IDE?
    2) Does this mean that you can also download your GNAT IDE onto a Mac and then compile your same C++ program so that it will now work on Mac OS X?

    I'm thinking of switching over since, for one thing, it certainly doesn't hurt to feel comfortable with several IDEs, and it does seem like a major advantage if it makes transfer of programs to Macs easier.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I no nothing of the GNAT IDE (edit: Isn't this for ADA only?). But have you tried Mac's XCode? It's the de facto development environment for Mac. It uses the GNU toolchain so it should compile standard C++ code off the bat.
    Last edited by Mario F.; 08-31-2009 at 10:08 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    242
    When I got out of Wikipedia (wonder who was writing the GNAT article...) and looked at the AdaCore site, which is the source for GNAT, it looked to me like it was indeed very Ada-centric. I think it's designed for Ada but allows you to use multiple languages, one of which is C++. I concluded that it's at minimum more complicated than I care to deal with at the moment and probably not ideal for anything except Ada.

    I'll see what I can find out about XCode. Thanks for the help!

  4. #4
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    another option is to use a build system such as cmake to make your code platform-independent code IDE-independent also.

  5. #5
    Registered User
    Join Date
    Jul 2009
    Posts
    50
    OS X ships with a copy of xCode, or you can download it from the apple website. It's good for medium to large projects.

    For small applications I use TextWrangler and gcc(which gets installed along with xCode).

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Carbon is Mac's equivalent of the WinAPI. It's a C API.
    Cacao is an Objective-C API (but there may be bindings to other languages) which probably can indeed be compared to the .Net framework.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cross platform XML library
    By Josh Kasten in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2007, 04:04 PM
  2. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  3. Cross Platform Socket Programming?
    By CrazyNorman in forum Networking/Device Communication
    Replies: 8
    Last Post: 07-19-2005, 02:38 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. cross platform game programming
    By xddxogm3 in forum Game Programming
    Replies: 13
    Last Post: 08-22-2004, 09:40 AM