C++ question

Discussion in 'Mac Programming' started by mark28, Jul 8, 2011.

  1. mark28 macrumors 68000

    Joined:
    Jan 29, 2010
    #1
    Do C++ libraries work in Xcode / Cacao?

    I'm not going to run into problems if I program in C++ with Xcode / Cacao for Windows users?
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    Cocoa is not C++, but Objective-C. You could use Objective-C++ to use Objective-C objects from C++ code.

    Whether you can take your C++ code to Windows, or vice-versa, will depend on the portability of C++ code in question. In particular, whether the libraries the C++ code relies on is portable. Which IDE is used to create the C++ code is not much of a factor.
     
  3. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #3
    You might also want to read this recent thread: http://forums.macrumors.com/showthread.php?t=1180274 while the IDE used to write the code will not matter, you will likely use different code for the two platforms to develop your GUI unless you use something cross-platform like wxwidgets. If you do your code will generally look a bit "foreign" on all systems so YMMV.

    B
     
  4. ehoui macrumors regular

    Joined:
    Jan 27, 2011
    #4
    What is the example of an application with a x-platform GUI that actually looks good? Games do not count. I can't think of one. Can you?
     
  5. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #5
    Nope. that's what I was saying. They generally don't look "right".

    B
     
  6. itsmrjon macrumors regular

    Joined:
    Jun 11, 2011
    Location:
    Chicago
    #6
    VisIt visualization tool... looks great on mac, linux, and windows
     
  7. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #7
    Are you serious?! VisIt neither look nor feels anything like a native Mac OS X app.
     

    Attached Files:

  8. itsmrjon macrumors regular

    Joined:
    Jun 11, 2011
    Location:
    Chicago
    #8
    I agree it doesnt look native... but it looks good! or atleast imho it does

    or maybe i'm just so used to linux I don't recognize it.. and visit looks 20x better than TecPlot or FieldView on a mac

    ok ok.. how about Qt
     
  9. PatrickCocoa macrumors 6502a

    Joined:
    Dec 2, 2008
    #9
    There are many things I don't know

    I don't know what VisIt is, but I know that it doesn't look great on mac, linux, and windows. Whatever it is can look great on AT MOST one of the three.
     
  10. Manderby macrumors 6502a

    Manderby

    Joined:
    Nov 23, 2006
    #10
    The answer to the first question is Yes. One important hint at the beginning: Objective-C files have the suffix .m, Objective-C++ files have .mm (two emms). This should spare you some hours of frustration.

    Aside from that, its XCode and Cocoa, not Xcode and Cacao. And you won't run into problems different to any other cross-plattform code. Which means: You may experience a lot. Starting-Hint: Be very careful with templates, try to stay away from STL if possible. They do not always compile or even behave the same way on different platforms/compilers/configurations.
     
  11. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #11
  12. Mac_Max macrumors 6502

    Joined:
    Mar 8, 2004
    #12
    VLC, Mathematica, and Google Earth use QT and seem just fine to me GUI wise.
     
  13. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #13
    VLC looks very foreign to me. That doesn't stop me from using it.

    B
     
  14. Kenndac macrumors 6502

    Kenndac

    Joined:
    Jun 28, 2003
    #14
    Cocoa isn't any language, it's a framework. /nitpick

    A lot of Cocoa's APIs are in C, too. Most of the Cores, for example.
     
  15. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #15
    VLC has platform-specific UI layers. Depending on your version, the Mac OS X UI for VLC is either Carbon or Cocoa.


    Loose language on my part. I meant Cocoa is not written in or developed for C++, but Objective-C.
     

Share This Page