Solved

Xcode and C++

Posted on 2012-03-23
2
761 Views
Last Modified: 2016-02-10
I have experience with programming Mac when ThinkC was the only option for C++. Recently I have been asked to convert a Windows C++ program to later Macs running OS X. I know that Xcode will compile C++ code, but I wonder how easy and effective that will be.

If I am using Xcode with C++, will I have the advantage of Cocoa and its developer GUI? Or will I be unable to take advantage of the new tools that come with Xcode for programming since Cocoa is written in Object-C? Will I have to develop the user GUI in Object-C which will then (somehow?) call up C++ function code for execution?

In sum, will I be able to integrate C++ code with the Xcode user GUI objects (windows, menus, dialogs, etc.) without having to jump through hoops. And, last but not least, will I have the advantage of using the developer's GUI if I'm programming in C++ with Xcode?

By the way, the Windows code is written in Visual C++ MFC with a lot of old code that's not object oriented.  I'm aware that I will need to strip out all of the MFC and Windows API code and port over just the code governing the underlying functions.

Last, but not least, is software developed for the Mac still tied to the event loop for its overall operation.

Thank you.
0
Comment
Question by:SilverJade
2 Comments
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 500 total points
ID: 37760078
Xcode is a great IDE for the C++ project. You can write, compile, debug, etc. It works perfect.

Cocoa is set of frameworks written in Objective-C. It's not C++.
If you'd like to write the standard GUI, it will be easier to use Cocoa.
But Mac OS X projects project may contain Objective-C and C++ code.
Carbon is an older brother of Cocoa and it's written in C (like Win32 API).

There is no MFC for Mac OS. At least not in the SDK's from Apple.

Seems like Qt is the tool that may help:
http://qt.nokia.com/
http://en.wikipedia.org/wiki/Qt_(framework)

Writing C++ Programs on Mac OS X
It's an old blog post, but it's about your question.
0
 

Author Closing Comment

by:SilverJade
ID: 37761910
Thank you for the information and the links. Qt looks like a winner because of the cross-platform capability (Windows and Mac). I wonder, though, how easy it will be to use the Qt platform for designing windows, menus, etc., or if the developer ends up coding most of the user's GUI. Also, surely textedit in OS X no longer has a 32K limit, right? That limit created major problems when I was programming for the Mac several years ago.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is Python programming? 3 102
How can i compile this github project?? 2 74
index Out OF Range Exception error 4 53
smartboard connectivity and software 6 33
We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now