Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ development on Mac [closed]

I have till now mainly concentrated on web programming thus far and now want to enter application programming space. I use a mac, and wanted to know what sort of compilers, IDEs etc people generally use for c++ dev.

extremely n00b One more thing immensely bothering me was the fact that c++ compilers generally output .exe which can't be used on macs. I need to understand basic OOP programming fundamentals and thought c++ would be the best choice. Please suggest something.

like image 636
amit Avatar asked Feb 28 '10 19:02

amit


People also ask

Can I run C program on Mac?

To run the C program in MacOS we need a code editor and code compiler. The Code editor is used to write source code while the code compiler converts the source code into executable files. To write the source code Microsoft Visual Studio Code is used while to convert it into executable files we use command-line tools.

What IDE should I use for C on Mac?

Visual Studio Code is open-source code editor developed by Microsoft. It is one of the best C IDE for Mac which provides smart code completion based on variable types, essential modules, and function definitions.


1 Answers

Compiling C++ on a certain operating system (OS) will create an executable file for that OS. You are not limited to only a .exe binary file.

The first step to start creating your first C++ application is to install Xcode. This development program is not installed by default with Mac OS X. You must insert one of the DVDs that came with your computer and install it. After, start Xcode and click on File and then New Project. Once that is done, select Command Line Tool and make sure that C++ stdc++ is the selected type. Before I forget to write this, Xcode's compiler for C++ is gcc. If you need some help to start off you always visits some sites or buy (or rent) some books.

One thing to note is that Apple's main programming language is Objective-C which is different from C/C++. While both of these languages have common features, it might be easier to start with Objective-C. It is possible to do some OOP with Objective-C and it will be easier with it. On the other hand, it is possible to do more complex OOP with C++ than with Objective-C.

If you ever wish to learn the basics of the Cocoa Framework (which is a set of libraries and tools to help you create a window), I suggest you learn how to program (some Objective-C or C++ could be nice) and buy the book Cocoa Programming for Mac OS X from Aaron Hillegass.

like image 188
Partial Avatar answered Nov 02 '22 17:11

Partial