gedit
Moderators:Labib, bristy1588
Can anyone tell me how i can compile a code witten in gedit? please reply me soon.
Re: gedit
Gedit is basically for editing ( I am guessing ). However,you can compile and run from it with the help of something called RunC. Follow the instructions here
http://www.ioi2010.org/environment/runc.shtml
Using RunC is very easy.Ctrl+R will do the compiling and running.Its not the best of options however.
My advice,install geany in ubuntu =) Its really Cool =)
Let us know what you coded
http://www.ioi2010.org/environment/runc.shtml
Using RunC is very easy.Ctrl+R will do the compiling and running.Its not the best of options however.
My advice,install geany in ubuntu =) Its really Cool =)
Let us know what you coded
Re: gedit
Go to terminal and type:
After installing it go to Gedit > Edit > Preference > Plugins
Then tick Embedded terminal.
Now write a code, suppose something.c, when you need to compile it hit Ctrl+F9 and then enter. If compilation is OK, enter to run.
For C++ you need to install g++, go to terminal and type
And to compile a code named something.cpp enter
Running process is same as C.
Code: Select all
sudo apt-get install gedit-plugins
Then tick Embedded terminal.
Now write a code, suppose something.c, when you need to compile it hit Ctrl+F9 and then enter
Code: Select all
gcc something.c
Code: Select all
./a.out
For C++ you need to install g++, go to terminal and type
Code: Select all
sudo apt-get install g++
Code: Select all
g++ something.cpp
ধনঞ্জয় বিশ্বাস
Re: gedit
I tried to compile this codeCorei13 wrote:Go to terminal and type:After installing it go to Gedit > Edit > Preference > PluginsCode: Select all
sudo apt-get install gedit-plugins
Then tick Embedded terminal.
Now write a code, suppose something.c, when you need to compile it hit Ctrl+F9 and then enter. If compilation is OK, enterCode: Select all
gcc something.c
to run.Code: Select all
./a.out
Code: Select all
#include <stdio.h>
int main()
{
int a, b, sum;
scanf("%d", &a);
scanf("%d", &b);
sum = a + b;
printf("Sum is: %d\n", sum);
return 0;
}
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
what's the problem?
অম্লান সাহা
Re: gedit
it works
আমি কোডটারে সেভ না করেই কম্পাইল করতে গেছিলাম। এরর তো আসবেই। what a fool i am.
btw, thanks dj
আমি কোডটারে সেভ না করেই কম্পাইল করতে গেছিলাম। এরর তো আসবেই। what a fool i am.
btw, thanks dj
অম্লান সাহা
Re: gedit
Gedit is only designed to be a really good editor, not an IDE.
If you have a proper makefile then I believe F8 or F9 is the shortcut key to have gedit run 'make' in the current directory...
Otherwise just switch to the shell prompt and run the GCC yourself:
% g++ -Wall myprog.cpp -o myprog
% ./myprog
The first line compiles "myprog.cpp" into an executable named "myprog" (instead of "a.out").
Assuming there are no errors, the second line executes your program.
If your shell is locked because you started gedit with
% gedit myprog.cpp
instead of
% gedit myprog.cpp &
then you can fix it by:
1. Make sure the terminal window is active
2. Press Ctrl+Z to suspend the foreground process (gedit)
3. Type
% bg 1
to move job 1 (your gedit process) to the background.
If you have more than one process running, you can learn the job number by asking
% jobs
If you have a proper makefile then I believe F8 or F9 is the shortcut key to have gedit run 'make' in the current directory...
Otherwise just switch to the shell prompt and run the GCC yourself:
% g++ -Wall myprog.cpp -o myprog
% ./myprog
The first line compiles "myprog.cpp" into an executable named "myprog" (instead of "a.out").
Assuming there are no errors, the second line executes your program.
If your shell is locked because you started gedit with
% gedit myprog.cpp
instead of
% gedit myprog.cpp &
then you can fix it by:
1. Make sure the terminal window is active
2. Press Ctrl+Z to suspend the foreground process (gedit)
3. Type
% bg 1
to move job 1 (your gedit process) to the background.
If you have more than one process running, you can learn the job number by asking
% jobs