PDA

View Full Version : command line compiling.


computoman
02-22-2008, 08:54 PM
>----------------------------------------------------------------------------
>Typical software install:

>for general install of software.
>from the command line (you may have to get a super user or root user to do this for you):
>to get a compiler for ubuntu and debian

sudo apt-get install build-essential

>download and untar the software
tar zxvf program.tar.gz
cd program

./configure
make
>in some cases as root (super user) you may have to enter:
make install

>----------------------------------------------------------------------
>Roll your own:
>For general "c" programming to do your own c language program
>create a source code file with a text editor. I use vim. You can get c programming books dirt >cheap.
>source code:

#include <stdio.h>
main()
{
printf("Hello, world! \n";
return(0);
}

>save the file sourcefilenname
>to compile a program (of course you can use shorter names)

gcc sourcefilename -o executableprogramname

chmod 700 executableprogramname

>to run it use:

,/executableprogramname

>It prints out:

Hello, world!

>Not that glamorous, but it is just a start for bigger things to come.

computoman
02-22-2008, 08:56 PM
printf("Hello, world! \n"; s/b printf("Hello, world!\n");