LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compiling? (https://www.linuxquestions.org/questions/linux-software-2/compiling-390623/)

Blue_Pheonix 12-08-2005 02:41 PM

Compiling?
 
Okay, I am a complete linux newbie, coming over from the WindowsTM world, and thoroughly sick of WindowsTM...

What is compiling?
What does it do?
What is its purpose?

As you can see, I have no idea...

All help is greatly appreciated...

linux=future 12-08-2005 03:12 PM

Compiling turns source code (such as a file that ends in .c) into machine code (.exe if under windows). Source code is what a programmer can modify. It can be read by humans. Machine code consists of a long line of 0's and 1's, which can be read only by a computer. The most common compiler for Linux is GCC.

bigrigdriver 12-08-2005 03:14 PM

Start with the simple concept: a programmer writes program code. Now, how to get the computer to execute that code. The programmer write in a programming language, but the computer only understands binary code: ones and zeros.

Enter the compiler. It changes the progamming source code to binary object code which the computer can execute. In the process, it removes all comments and whitespace which are aids to the programmer in making the source code readable. The computer doesn't need those. The binary (object) code files is smaller that the source code file because of that.

In contrast, langusges such as basic, java, various scripting languages are interpreted instead of compiled. The source code is read by the intrepreter and binary code comes out, which the computer can understand and execute.

If future, you might consider using www.google.com/linux to search for answers. The volume of all kinds of information on the web is enormous.

Blue_Pheonix 12-08-2005 03:25 PM

Many thanks! I'm glad to finally understand it.

btw, i googled "compiling" and all i got was "how to compile such-and-such program files"

for once, google.com was not all that helpful...

many thanks, though:D


All times are GMT -5. The time now is 12:30 AM.