Results 1 to 10 of 13
hi,
how to compile c pragram in ubuntu. is it need any compiler or application.
help me briefly .. new to c program...
- 12-05-2007 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 52
c programming
hi,
how to compile c pragram in ubuntu. is it need any compiler or application.
help me briefly .. new to c program
- 12-05-2007 #2
To compile,
To run,Code:#gcc filename.c
Edit:Code:#./a.out
gcc compiler comes as default in most distros.so you won't need any new compiler.- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 12-05-2007 #3
Another way is
Code:$gcc -o prog prog.c $./prog
- 12-05-2007 #4
You need to install the compiler first like,
sudo apt-get install gcc
if gcc is installed successfully then you can compile the program by using the "cc" or "gcc" like,
cc hello.c or gcc hello.c
And you need to install the library also.
- 12-05-2007 #5
To develop on Ubuntu, I recommend you install the "build-essential" metapackage:
That includes gcc and a host of other things.Code:sudo apt-get install build-essential
Registered Linux user #270181
TechieMoe's Tech Rants
- 12-05-2007 #6Just Joined!
- Join Date
- Nov 2007
- Posts
- 52
how to create .c file and where?
no info in ebook ...
- 12-05-2007 #7
You just use an editor such as VI/M, Emacs, KATE, Gedit etc. Another option is to use an IDE like KDevelop, Anjuta, Geany, Eclipse etc. You can just sotre the files somewhere in your home directory.
- 12-06-2007 #8Just Joined!
- Join Date
- Nov 2007
- Posts
- 52
i have created a hello.c in desktop . how to compile in terminal.
- 12-06-2007 #9
Ok....In Fedora we used to Click on,
System Tools -- > Terminal ( i guess its should be same in ubuntu )
To get into terminal,
From there go to ur file directory say(i assume ur login name is oss),
HTHCode:cd /home/oss/Desktop gcc filename.c ./a.out
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 12-06-2007 #10
If you want your programs to have a name thats more meaningful than a.out, the use the -o flag in gcc e.g.
You would then run the program by doingCode:$gcc hello.c -o hello
Code:$./hello


Reply With Quote