answersLogoWhite

0


Best Answer

You compile a Linux program with the 'make' command. Most of the time, Linux programs come with a makefile, which is a list of instructions that 'make' can use to build the program. You would just type 'make', or 'make target'. (But you've got to study this, and read the makefile.)

In the simplest case, without 'make', you can compile and link the hello.c program with the 'cc -o hello hello.c' command or, if 'make' is installed, you can use default rules by using the 'make hello.c' command.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Compiling is the process of parsing source code as input to the compiler and outputting one or more object modules. In true compilers, this is usually not sufficient to produce an executable program. After compiling, the object modules must be linked with a linker to store the object modules referenced by the source code's prototype declarations into the binary. After all this is done, assuming there are no error aborts, an executable binary should be produced.

This explanation is somewhat over simplified, but it should provide you a general idea.

On Linux, the programs that may be involved could be 'gcc' and 'ld' at a minimum, though 'yacc', 'bison' and 'lex' may also be used, among many others. 'gcc' is the actual compiler, 'ld' is the linker, 'yacc' is the compiler compiler, 'lex' is the lexical analyzer generator and so forth.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you compile programs in Linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you run programs compiled with Turbo C on Linux?

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.


In what directory should you write device driver programs in OpenSUSE Linux?

You can write them in whatever directory you want. You need to compile them with your kernel, however.


How do you compile and run the shell programs through vi-editor in Linux?

You don't Shell files/programs are not compiled. If you want to run a process through 'vi' then use the ':!' 'ex' command to shell out and execute it.


How do you edits program using Linux compiler?

You don't. The compiler is used to compile programs, not edit them. Most source code can be edited using a standard text editor.


Why do Linux programs not run in Windows?

The 2 operating systems are different from each other. Linux programs aren't meant to work in Windows most of the time. If you want to run Linux programs in Windows, install cygwin, and compile them from source code.


Is there a free service that compiles C programs for Linux?

Linux generally comes installed with the free gcc compiler. MacOSX does too. But when you compile a program with gcc, it runs on the platform under which it was compiled. Therefore, programmers on OSX that need to deliver a Linux binary need to use gcc's cross-compiler mode to produce Linux binaries.


How do you compile java programs using windows vista text pad?

How can I compile java programs using windows vista text pad?


How do you become a Linux developer?

There's no specific training or certification necessary to write programs for Linux. Anyone who knows C, for instance, can write programs and compile them, just as they would on any other platform. If you meant a Linux kernel developer, there's no formal qualifications. Just submit any patches to a current developer. If you continue to submit good code and start your own git tree, more people will likely pull from you.


Do you have to compile Linux software before using it?

You can if you really want to! But, most Linux software is already compiled and ready to be downloaded and installed. Note that Linux is the kernel from which many distributions (distos) branch out - Ubuntu, Linux Mint are but two examples.


Can you install Adobe programs on Linux?

Adobe does make a few programs available for Linux, namely Adobe Flash Player and Adobe Acrobat Reader. Adobe does not make programs like Adobe Flash or Photoshop available for Linux, and recent versions of these programs do not work in Wine.


On Linux how many kernels you can compile at the same time and how many kernels you can load in Linux?

You can have as many compiled kernels in your Linux installation as you want (disk space is your limit). However, you can only boot one kernel at a time.


How do you run and compile a java applet program?

One can run and compile a Java applet program by agreeing to the terms and downloading it. It is possible to get a compiler online that will compile and run Java programs.