The first step is to install the XCode developer tools that comes with OSX. You can do this by looking on your OSX install disc. There should be a folder for optional installs, and a package for XCode. This will automatically install gcc, a C compiler, on your machine. Next, find the Console in the Utilities folder. It opens a UNIX shell. Move to the directory that your c file is in (you can find more information about UNIX elsewhere if you need to). Let's say your C file is named myfile.c. To compile it, type: gcc myfile.c This will compile your program, and name the compiled program a.out. To run it, type: ./a.out I hope that helps. Brina
In Linux you can use the gcc [Gross C Compiler] compiler for compiling a C program. The file will be compiled and if no errors object file will be created, which can be executed by giving typing './a.out' in the current path. You can also specify a name to the output file. If you specify a name, after compilation a new file will be generated in the name you have specified, with a '.o' extention
For more information on gcc, type
'man gcc' or 'gcc --help' in the shell prompt.
AnswerIn Windows, you will need a compiler/builder like Microsoft Visual C++ Express or Dev-C++, both of which can be downloaded free of charge on the internet. Once you have this set up, open the project in the appropriate program (for help on this see the program's help files), and choose the Build option (or similar) from the menus at the top of the program's window. The Windows executable file (with file extension .exe) will most likely be in the same folder as the project provided there were no errors.Double click it in Windows Explorer, and it will execute. If it's a command line program, the output may dissappear too quickly to be visible. In this case, press Windows+R to bring up the Run dialog. Type in 'cmd' (no quotes), and the Command Prompt should appear. navigate to the correct directory using 'CD ..' to go up a directory and 'CD [directoryname]' to go into a directory. From there, type the executable file's filename and hit Enter. The program should run.
The exact syntax will vary depending on the compiler you're using.
Using GCC as an example:
gcc -o MyProgram.exe MyProgram.c
MyProgram.exe
Executing the first command above will take a program stored in MyProgram.c and compile it to MyProgram.exe. The second command will run the program.
Xcode and Eclipse are popular choices for developing Mac programs. Compilation is usually achieved with a modified version of the GNU Compiler Collection.
Note that you need both a compiler and a linker to create an executable. Compilation is the process of converting source code into object files. Linking is the process of linking those object files and the required libraries to generate the actual machine code. Although separate processes, most IDEs will perform both with a single command.
To compile and run a C# program in Visual Studio.NET, open the program file in Visual Studio. Then, click on the "Build" menu and select "Build Solution" to compile the program. Once compiled successfully, press F5 or click on the "Debug" menu and select "Start Debugging" to run the program.
Turbo C cannot compile native Linux binaries, only programs for MS-DOS. MS-DOS applications can be run on Linux through a variety of methods, including DOSEMU, DOSBox, QEMU, Bochs, and VirtualBox.
You can compile, link and execute programs without text-editor.
The compiler demands it: your programs wouldn't compile without them.
The source files take a longer time to compile, and reading and maintaining such programs is harder.
Use Xcode. See related links below.
To compile and run a C# program in Visual Studio.NET, open the program file in Visual Studio. Then, click on the "Build" menu and select "Build Solution" to compile the program. Once compiled successfully, press F5 or click on the "Debug" menu and select "Start Debugging" to run the program.
Turbo C cannot compile native Linux binaries, only programs for MS-DOS. MS-DOS applications can be run on Linux through a variety of methods, including DOSEMU, DOSBox, QEMU, Bochs, and VirtualBox.
Because the source programs just do not run. Full stop.You have to1) compile them to an executable (C)2) use a program that interprets them (script languages, eg. sh, perl, php)3) mix the two: half-compile them into something that can be interpreted by another program (source -> javac.exe -> bytecode -> java.exe)
Code, compile, link, run.
There are many C compilers. In modern usage, the most common ones are Microsoft Visual C++ (which can also compile C programs) and GCC (GNU Compiler Collecttion, originally GNU C Compiler).
You can compile, link and execute programs without text-editor.
You can write, compile and execute C-programs in both DOS and Unix, if that's what you meant.
The compiler demands it: your programs wouldn't compile without them.
C++ programs won't compile if they contain compiler errors. The compiler will tell you precisely where the error is, and the type of error, unless the error is in a macro. The compiler cannot see macro definitions because they are inline expanded prior to compilation.
The source files take a longer time to compile, and reading and maintaining such programs is harder.
Yes. There are C compilers for MS-DOS and for Xenix. Santa Cruz Operation OpenServer can compile programs to run on Xenix. See http://williambader.com/museum/dell/xenixhistory.html