views:

372

answers:

8

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 cant be used on macs. I need to understand basic OOP programming fundamentals and thought c++ would be the best choice. Please suggest something.

A: 

Just use xcode / gcc to create and compile C++ applications on your mac. Native Mac applications are most commonly coded in objective-C, but since the mac is a variant of bsd, using gcc tools to create a c++ executable is also common.

edit: to clarify: - xcode is the free Mac IDE that comes on the install disk - gcc is the open source compiler. it is part of Xcode.

darren
A: 

If you are using a Mac Xcode is the way to go, there are of cause others out there, like Net Beans and Eclipse

Arkain
+2  A: 

A c++ compiler will output object code that should be native to the platform the compiler is built for. So on a mac it will output executable programs that will work on a mac, not windows executables.

XCode is a well regarded mac IDE that you can use for C++ development.

Java may be an easier choice for OOP as it avoids many pitfalls that can catch out novices. Another OOP alternative is Objective-C which is a good choice for mac development.

sfg
-1: It would be easier to do Objective-C than Java in a Mac OS environment and if the OP wants to learn C++ later on.
Partial
+2  A: 

C++ is not restricted to .exe files.... window PE files are one container format for machine code. A C++ binary can be encased in any low-level container format you can think of.

Objective-C on the mac can be a very pleasant language to learn, also Java. Do you really need to learn C++ at this junction ? C++ is suited to low-level programming problems -- i.e., video games, system software, and generally performance-critical software (photoshop and imovie).

Hassan Syed
Learning C++ before any other programming language can make it easier to learn new languages afterwards. C++ is a multi-paragdim language so it is possible to see multiple ways of programming inside one programming language.
Partial
@partial While that is a nice sentiment, it is counter-productive in practise -- people are mostly motivated to learn a language to gain the expertise to solve a problem, and they don't care about reaching enlightenment -- or perhaps to attain enlightenment through time and experience -- for example: Why sould someone wanting to drive to work know how to drive a rally car ? ? sure it might improve their situation when they try to drive on icy roads .... in practise they can just drive slowly 2 days a year.
Hassan Syed
@Hassan Syed: ...icy roads, wet roads, bumpy roads, animal crossings, other drivers and so on. Yet if we had people with the experience, knowledge and reflexes of a rally driver on the road, there would be less accidents. The same can be said of programming. If you take the time to learn C++ you gain a certain mindset that will allow better programming in the end. Also, you will gain certain reflexes that you would not normally have with simpler programming language. This is not a sentiment, but a personal experience.
Partial
@Hassan Syed: Are you really saying that C++ does not give people the expertise to solve problems? Why would "video games, system software, and generally performance-critical software (photoshop and imovie)" be made with C++? It is a complex language! So what? Get over it! When you learn how to program, you learn the basics of a programming language first. Not the other way around. C++ allows people to learn step by step from functional programming to meta-programming, from static memory allocation to dynamic memory allocation, from conditional statements to for_each loops with functors, etc.
Partial
A: 

Comparison of integrated development environments - C/C++ http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C.2FC.2B.2B

I use Code::Blocks with gcc and a GNU toolchain for embedded development on a Mac.

tyblu
+3  A: 

If your question really is: can I use C++ to develop Mac applications, then the answer is yes, but for true native Mac applications you probably want to invest in learning Objective-C and the Cocoa frameworks.

St3fan
There are quite a few C++ based frameworks for Mac OS X as well. I/O Kit, for example.
dreamlax
I/O Kit uses 'Embedded C++' and it really is not a framework to do application development.
St3fan
Use objective-C++ and you can have your cake and eat it too. (And shoot your self in the foot with it ..)
Michael Anderson
+2  A: 

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.

Partial
A: 

If you are intended to build applications for MAC then best way is to learn "Objective C" and use Xcode editor on MAC. This will help you in long term as well. Xcode also allows you to build application using C/C++ and java, along with objective C.

A good way to start can be visiting this URL http://developer.apple.com/mac/, It has help also avail.

Unicorn