Thursday, July 30, 2009

I need C++ Help?

OK, so i wanted to write C++ on OSX. Someone told me to install Xcode, so I did. I opened it up, opened up a new C++ file, and typed a simple program from a tutorial. However, I can't compile it! The menu option for compile is grayed out (in fact all of the build tools are). Why can't I compile it?





Sorry, I have never programmed before (i have only done web design and XML; and a one-week crash course in computer class on C programming). In computer class we had a program (Borlan C or something) where we typed in our code, pressed compile, and ran the programs. That is the extent of my knowledge. Why won't Xcode let me do that, and how do I get it to let me?!?





Thanks.

I need C++ Help?
you get it from the second disk in an os x package or it's on the BIG dvd as an extra install!





if you don't mind downloading extra stuff, you can get your c compiler here


http://www.apple.com/downloads/macosx/de...
Reply:I guess you didn't install a compiler like gcc for example. Xcode doesn't come with a prebuilt compiler so you must install it afterwards.


Gcc is included with Xcode Tools so installing this should fix it.


http://developer.apple.com/tools/xcode/
Reply:"However, I can't compile it! The menu option for compile is grayed out (in fact all of the build tools are). Why can't I compile it?"


Probably because you didn't install the build tools. Xcode is just an IDE. That is, a nice environment for you type code and have it compiled for you. The actual compilation is done by the compiler.





I don't use Macs, but IIRC you should have a CD or set of CDs from Apple with developer tools on them. Install whatever is relevant to C++. It should be Gcc, gdb, the C++ libraries, etc.





"n computer class we had a program (Borlan C or something) where we typed in our code, pressed compile, and ran the programs. "


Yeah, basically they taught you nothing about C++.


No comments:

Post a Comment