View Full Version : how to compile\run a simple c program on ubuntu without using the terminal
seanbeltrami
May 24th, 2008, 08:15 AM
Hi
i'm new to programming.
I need to work the following simple program called somma(or any):
#include<stdio.h>
main()
{
int a,b,somma;
printf("INSERIRE I NUMERI DA SOMMARE");
scanf("%d%d,&a,&b);
somma=a+b;
printf("la somma di a+b e':\n%d \nArrivederci!\n",somma);
}
I really would not know where to start, i installed gcc (through terminali with gcc apt get install...)
Even better for me at the moment would be having a way not to use the terminal at all,as i did with devc++ or turbo c
where all u had to do was punch a button.
Can anybody help me step by step
Thanks
unutbu
May 24th, 2008, 08:28 AM
Save the program as somma.c.
Then type
gcc -o somma somma.c
./somma
I suspect there is a GUI that can do this for you, but I'm sorry, I don't know what it is. Perhaps someone else here will know.
brettg
May 24th, 2008, 08:42 AM
hmmm, "Absolute Beginner Talk" is probably not the best forum to post this question.
However, if you install Eclipse you can compile and run C programs "without using the terminal"
barnex
May 24th, 2008, 09:20 AM
Netbeans is a simpeler alternative to eclipse, it's also an IDE for C++ (and java, ...). Just see which one you like best.
Hospadar
May 24th, 2008, 10:08 AM
I also like Kdevelop for C/C++ development. It's a very nice IDE from KDE, but it runs well under gnome.
whitethorn
May 24th, 2008, 10:43 AM
Hi, you can also try geany out. It's a really nice small program. It lets you compile and test run different kinds of programming languages.
http://geany.uvena.de/ Link to the homepage
It's available in the repositories.
catanzag
May 25th, 2008, 02:40 PM
I use command line or eclipse, but just to complete the list, also Anjuta should be cited; it is the IDE for C/C++ in gnome, if I'm not wrong.
regards
shankhs
May 28th, 2008, 11:34 PM
u can use anjuta
download from here:
http://anjuta.sourceforge.net/downloads
iaculallad
May 28th, 2008, 11:38 PM
Before compiling your source codes, you might as well install the "essential" files.
Code:
sudo apt-get install build-essential
LaRoza
May 29th, 2008, 12:58 AM
See the sticky in the Programming Talk. It has a link to two threads which explain everything.
LaRoza
May 29th, 2008, 12:58 AM
Thread Moved.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.