Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Complete solution for writing Mac OS X application in C++

Tags:

c++

xcode

macos

ide

I am looking for alternatives for my current box and Mac OS X seems very appealing.

My main area of interest is C++ programming. Currently I'm using Eclipse + CDT and g++ for creating my software; sometimes it is KDevelop.

I know that primary IDE for Mac is Xcode and primary language is Objective-C. I would like to avoid learning Objective-C if at all possible. I've also heard/read that there are some issues in accessing Mac OS X APIs from C++.

Hence my question: what is the complete solution for developing/debugging/testing C++ applications that access all aspects of hardware (UI, sound, video/accelerated video, etc.) for Mac OS X?

Edit: how does Xcode compare to the Eclipse+CDT combo? If this comparison is at all possible...

like image 626
Marcin Gil Avatar asked Mar 11 '09 12:03

Marcin Gil


People also ask

Can you write Mac apps in C?

With this knowledge, we can build a simple GUI application that runs on MAC OSX using less than 50 lines of code in a single C program. This program can then later be turned into a bundle for Mac OSX to be able to open and close directly. Installing GTK on your setup to compile your GUI.

Is OS X written in Objective-C?

Objective-C was the standard programming language supported by Apple for developing macOS (which descended from NeXTSTEP) and iOS applications using their respective application programming interfaces (APIs), Cocoa and Cocoa Touch, until the introduction of Swift in 2014.


1 Answers

If you want to use C++ instead of Objective-C, and still want to avoid an intermediate layer of libraries (such as QT), you can use Carbon.

I would use XCode instead of Eclipse simply because Eclipse is way slower when dealing with hardcore C/C++ programming (compiling, debugging, testing).

When I first started to program in Mac OS X, I was in the same page you are now. I thought it was better to stick to the language I knew (C++) and use an older library (Carbon). For some reason I don't remember now, I forced myself into Cocoa (Objective-C). Looking back, I think it was a good thing because:

  1. Objective-C is not fundamentally different to C++
  2. Cocoa is better, faster and simpler than Carbon
  3. iPhone Dev is exclusively Cocoa (Carbon is not supported)
like image 157
Pablo Santa Cruz Avatar answered Oct 13 '22 12:10

Pablo Santa Cruz