Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SnowTronic

macrumors member
Original poster
Mar 21, 2011
42
0
Wirelessly posted

Just starting out in programming, I've learned the basics of programming in c++ in windows I want to use Xcode on Mac but the problem is Xcode won't run c++ code because it's g++ complier the only thing is people on the web say a g++ compiler will run c++ code but I can't seem to figure out how to do this....so how do you do this? Any help is greatly app.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
Wirelessly posted

Just starting out in programming, I've learned the basics of programming in c++ in windows I want to use Xcode on Mac but the problem is Xcode won't run c++ code because it's g++ complier the only thing is people on the web say a g++ compiler will run c++ code but I can't seem to figure out how to do this....so how do you do this? Any help is greatly app.

You seem to be very confused. XCode comes not with one, but with two C++ compilers: The gcc compiler version 4.2, and the latest LLVM compiler.

Start XCode, choose "New Project", and then have a good look at all the options that are there.
 

thundersteele

macrumors 68030
Oct 19, 2011
2,984
9
Switzerland
g++ is a C++ compiler. The compiler is not the problem here.

Xcode takes some learning, in particular to understand how to set up projects and include code that was written elsewhere. I suggest that you start a new "Command Line Tool" project and try to get a simple "Hello World!" program to run.

Finally, if you are using Windows specific libraries in your old code, it won't compile on the Mac.

Let us know if you have further questions.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.