# where does the compiler present...



## Ashokkumar01cbe (Sep 15, 2012)

i am using codeblocks for doing my c and c++ program , everybody knows that object code for a program is generated by complier .and that source code will vary depending upon the OS , for a same program. but my question is that is the compiler comes with the codeblocks software,or it is integrated to the OS..please tell me..


----------



## vickybat (Sep 16, 2012)

^^ Compiler is integrated with an IDE & not OS. Linux has an inbuilt GCC compiler though.

Codeblocks is an ide and compiler is integrated with it.


----------



## ico (Sep 16, 2012)

Ashokkumar01cbe said:


> i am using codeblocks for doing my c and c++ program , everybody knows that object code for a program is generated by complier .and that source code will vary depending upon the OS , for a same program. but my question is that is the compiler comes with the codeblocks software,or it is integrated to the OS..please tell me..



Download binary

When you download from here, you see two options for Windows.

*codeblocks-10.05-setup.exe* - this one is to be used if you have a compiler already installed.
*codeblocks-10.05mingw-setup.exe* - this one comes with the MiniGW compiler for Windows which is actually based on GCC.


----------



## Ashokkumar01cbe (Sep 16, 2012)

Hi,
If a program named HECTIC when it is complied in windows ultimate installed with codeblocks, an object code is generated ,is the object code same when it is complied in MACINTOSH computer or different..


----------



## ico (Sep 16, 2012)

Ashokkumar01cbe said:


> Hi,
> If a program named HECTIC when it is complied in windows ultimate installed with codeblocks, an object code is generated ,is the object code same when it is complied in MACINTOSH computer or different..


There are two steps.

Compiling and Linking - Cprogramming.com

You could assume that Object Code is same. But the Linker, (Linker is what creates the executable file), Linker output is different.


----------



## vickybat (Sep 17, 2012)

^^ That's a nice link gagan.


----------



## Ashokkumar01cbe (Sep 17, 2012)

If a java program named digit is compiled and executed in a windows pc ,an class code is generated same as object  code in c..is the  class code is generated via compiler then in windows there is no complier is installed .how is it generated..... please explain me ......


----------



## Neo (Sep 17, 2012)

Java compiler was installed with the JDK. The class code was generated via the Java compiler and not the IDE.


----------



## vickybat (Sep 18, 2012)

Ashokkumar01cbe said:


> If a java program named digit is compiled and executed in a windows pc ,an class code is generated same as object  code in c..is the  class code is generated via compiler then in windows there is no complier is installed .how is it generated..... please explain me ......



When you compile the "digit" java code, the compiler generates a java bytecode. This bytecode is platform independent and needs a java virtual machine to run or something that can interpret the bytecode.
In java, we have java virtual machines or simply JVM which interprets the bytecode generated by compiler and JVM is compatible with a lots of devices from handhelds, systems, consumer electronic gadgets etc and any system running a JVM can read and run the bytecode generated.

So java bytecode is termed as platform independent and can run in any system that has a JVM.


----------



## shanthi (Jan 16, 2013)

when we compile a program,class file is generated and that is not in read mode in this case we use Java virtual Machine which is platform dependent that makes class file as independent platform and make sure it runs in different OS.Each browser will have JVM.


----------

