Skip navigation

Xcode c++ GUI

1283 Views 8 Replies Latest reply: Dec 26, 2012 6:46 AM by etresoft RSS
ajzpop Calculating status...
Currently Being Moderated
Dec 24, 2012 8:54 PM

Does Xcode support the development of GUI with c++? I have been able to develop console c++ program but I can't find any info on c++ GUI. Surely Xcode is up to the task.

  • g_wolfman Level 4 Level 4 (1,110 points)
    Currently Being Moderated
    Dec 25, 2012 9:19 AM (in response to ajzpop)

    You can develop C++ GUI applications on OS X using Xcode.  But Apple's Developer Tools don't include any C++ UI libraries, so you'll have to choose a set of libraries for GUI development.


    Qt is a popular one (mainly because it's also supposed to be cross-platform).  It also has its own IDE, Qt Creator, and its own build system.  And it's massively bloated (because it does everything, not just GUIs).


    There's also WxWidgets, which is also fairly popular...and no two widgets have a consistent interface, so there's a moderate learning curve (and frustration).  Most other GUI libraries have similar design issues.


    GUI development on C++ has never been particularly well sorted out.  If you are developing for OS X only, you are probably best off learning Objective-C for the GUI, even if the rest of the code is in C++.

  • etresoft Level 7 Level 7 (23,890 points)
    Currently Being Moderated
    Dec 25, 2012 11:15 AM (in response to ajzpop)

    QT is free, but ugly. It would be a waste of time to learn that if you like Xcode and want to write Mac or iOS software. C++ is good for school because it is very difficult and that will help you learn to program. You will then find it much easier to work in a real, practical language. Don't waste any time with user interfaces in C++. You will never do that in school anyway.

  • g_wolfman Level 4 Level 4 (1,110 points)
    Currently Being Moderated
    Dec 25, 2012 11:20 AM (in response to ajzpop)

    In general, GUI development is platform specific (Cocoa for OS X,.Net for Windows, GTK+ for Linux). 


    If your classes are doing GUI development, you should use whatever they are.  If they are using Windows, then you need to use whatever tools and libraries they are using.  If they aren't doing GUI development, then do whatever you like - but remember that GUI development is generally platform specific.


    The exception to that generality is cross-platform suites like Qt (which isn't really completely cross-platform).  But, like Java, that portability comes at the cost of having a massive infrastructure and unique build system.  There's nothing wrong with wanting to learn and develop in it...just don't do it by ignoring your classes.


    Qt does have a free open-source licensed version.  You can look into it more on the Qt-project site:


  • g_wolfman Level 4 Level 4 (1,110 points)
    Currently Being Moderated
    Dec 25, 2012 5:19 PM (in response to ajzpop)

    Programs are written in almost any language you can imagine.


    GUIs are written (generally) in the native framework for the platform.  That means:


    OS X = Cocoa (Objective-C)

    Windows = .Net (C#)

    Linux = GTK+ (Tcl/Tk)


    Now, that's an oversimplification, of course (for example, OS X can run programs written in Tcl/Tk, especially using the X11 environment), but not much of one.  If a complex program is well engineered, its core will be written to be independent from any GUI layer.  So you may find a platform independent core, written in C++ or Python or Perl or C or just about anything, with different UI layers swapped in depending on the platform.


    That's what different language bindings are for.

  • etresoft Level 7 Level 7 (23,890 points)
    Currently Being Moderated
    Dec 26, 2012 6:46 AM (in response to ajzpop)

    That's all well and good. What g_wolfman has described is an "ideal". You will virtually never see such a thing. By that I don't mean "they aren't common" - I mean "they don't exist".


    If you want to write Mac or iOS software, you need to learn Objective-C - especially for the user interface portion. There is flat-out no other option. There are some low-level libraries that are supposed to be independent of any user interface and anything high-level like Objective-C. In these areas, C++ can be helpful if used judiciously.


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.