C++ / Obj C mash ups

Discussion in 'Mac Programming' started by rinseout, Jun 9, 2005.

  1. rinseout macrumors regular

    Jan 20, 2004
    Has anybody here written an application that does the GUI stuff using Cocoa/Obj C, but does all of the real work in C++ code?

    I know it's possible to, for example, link a program that with both Fortran and C objects, but is it possible to do this with Obj C and C++ together? It must be since it would be silly to re-write a C++ code base just to get a native app going. I guess the questions are: is it possible to do (in principle), and will XCode handle it easily?

    I have no existing Obj-C code, so if this is possible, is there a good way of going about doing this without making coding style people freak out?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    There are a few possible ways of doing this (although I have not done any of them).

    Apple's gcc allows for Objective C++, a kind of bridge between the two. This would result in a single executable.

    You could also run the C++ as a sperate non-GUI executable and use the standard methods for wrapping a command line app to provide the GUI.

Share This Page