Separate names with a comma.
Discussion in 'Mac Programming' started by Kwokho, Aug 20, 2008.
Is carbon c++ ansi? And is there any other compilers other than xcode which is ansi?
Carbon is an API. The ANSI standard relates to the language and makes no mention of APIs. In fact Carbon is actually a C API not C++. Xcode is an IDE not a compiler. The compiler that Xcode uses is GCC.
There is also the Intel C/C++ compiler for Mac OS X but that is not free.
I doubt very seriously that there is a C++ compiler that is ANSI compliant. How many support export? That's at least well known, who knows what else is in the standard that few if any compilers support.
What are you trying to achieve? Do you have some code that won't compile with the compiler you have, but you believe it to be standards compliant?
Also, Xcode is not a compiler, it is an IDE that utilizes gcc/g++/java for compiling various languages. You can use g++ from the command line and get the same results as with Xcode.
Perhaps you should define your problem more clearly and we'll be able to give you some better direction.
did you started programming with HELLO WORLD thing? If so where should I write it in xcode is it the source?
What resource are you learning to program with?
From the sounds of it I would skip Xcode at the moment and just work with a text editor and the command line. It will be much easier to learn to start out with, worry about Xcode later.
All you need to do is get a decent text editor (I recommend Smultron) and type your code in there. Save the file calling it anything you want but make sure to add a .c extension to it. Then open Terminal in /Applications/Utilities and navigate to the folder where you saved it (if you saved it to the Desktop you would type cd Desktop).
Once that is done type:
gcc -o myprog whateveryoucalledyourfile.c
and your code will be compiled and given the name myprog, obviously you will need to change the filename to whatever you called your file and you can change myprog to anything you like. To run your program type:
Slight modifications for C++:
Save your file as .cpp, .C, .CPP, .cc, .cp, .cxx, .c++. The first is the most common.
Instead of gcc, run g++:
g++ -o myprog whateveryoucalledyourfile
Oops, yes sorry about that. Forgot we were talking about C++.
how do I make it to a app?
like you can click on it in the dock?
That'll come later. Concentrate on learning the language first, making GUI applications is something you can worry about in a few months when you have got the basics under your belt. 99% of the stuff you do when learning will be command line based with a programming language like C++.