 |
02-01-2009, 10:08 PM
|
#1 (permalink)
|
|
learnhardy
Join Date: Oct 2008
Posts: 104
|
problem with c compiler in linux
Hi all,
i am new to linux system.
I am very comfortable with TURBO C or C++........now just i m shifted to dev C++(beta version),geany etc .......in my new linux system .....i have been facing problem with these compilers ......can u guys simplly tell me whts the main difference between these two ........how to set these compilers in linux??
__________________
__________________
Newbie......
celebrate an ancient art .....
http://ambika.99k.org
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
02-01-2009, 10:22 PM
|
#2 (permalink)
|
|
Section Moderator
Join Date: Mar 2007
Location: Hyderabad
Posts: 1,186
|
Re: problem with c compiler in linux
google GCC
|
|
|
02-01-2009, 10:36 PM
|
#3 (permalink)
|
|
learnhardy
Join Date: Oct 2008
Posts: 104
|
Re: problem with c compiler in linux
Quote:
Originally Posted by gopi_vbboy
google GCC
|
LOL.
I did googling ........... in ubuntu ,linux forum.........find that there is nothing i am doing wrong.........but i know something is going wrong .......with my compiler.
__________________
Newbie......
celebrate an ancient art .....
http://ambika.99k.org
Last edited by ambika; 02-01-2009 at 11:15 PM.
Reason: Automerged Doublepost
|
|
|
03-01-2009, 12:30 AM
|
#4 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: problem with c compiler in linux
Here's a start: C++ in knoppix
Also, since there is no conio.h in Linux, quit using clrscr and getch functions.
__________________
Harsh J
www.harshj.com
|
|
|
03-01-2009, 12:34 AM
|
#5 (permalink)
|
|
learnhardy
Join Date: Oct 2008
Posts: 104
|
Re: problem with c compiler in linux
hey qwerty i m going to leave this forum........
everyone assign me goggling .......if i find it difficult ......and not get .....right one by googling ....then??
__________________
Newbie......
celebrate an ancient art .....
http://ambika.99k.org
Last edited by ambika; 03-01-2009 at 12:37 AM.
Reason: Automerged Doublepost
|
|
|
03-01-2009, 12:43 AM
|
#6 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: problem with c compiler in linux
As you wish.
Give a code sample to help with.
__________________
Harsh J
www.harshj.com
|
|
|
03-01-2009, 01:07 AM
|
#7 (permalink)
|
|
learnhardy
Join Date: Oct 2008
Posts: 104
|
Re: problem with c compiler in linux
Quote:
Originally Posted by QwertyManiac
As you wish.
Give a code sample to help with.
|
u r laughing ?? ......
__________________
Newbie......
celebrate an ancient art .....
http://ambika.99k.org
|
|
|
03-01-2009, 07:19 AM
|
#8 (permalink)
|
|
Always confused
Join Date: May 2008
Location: Mandriva Control Center
Posts: 349
|
Re: problem with c compiler in linux
use gcc in terminal.
cc filename.c
./a.out
Why going for IDEs when you are a newbie?
Use terminal and vi editor ......
__________________
Vamsi Subhash
visit my blog at www.vamsisubhash.co.cc and taste a bit of IT!
|
|
|
03-01-2009, 07:37 AM
|
#9 (permalink)
|
|
God of Mistakes...
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
|
Re: problem with c compiler in linux
Before that, if you are using Ubuntu, then install build-essentials package by doing-
Code:
sudo apt-get install build-essentials
Then you can write your code in vi / gedit / kete as
Code:
vi filename.c
gedit filename.c
kete filename.c
After that, you can compile file using-
Code:
gcc filename.c -o filename
And now run by -
Hope, this will help.
|
|
|
03-01-2009, 07:54 AM
|
#10 (permalink)
|
|
Always confused
Join Date: May 2008
Location: Mandriva Control Center
Posts: 349
|
Re: problem with c compiler in linux
Quote:
Originally Posted by QwertyManiac
Also, since there is no conio.h in Linux, quit using clrscr and getch functions.
|
To clear the screen in linux, use system calls :
Code:
#include<unistd.h>
system("clear"); //inside any function
__________________
Vamsi Subhash
visit my blog at www.vamsisubhash.co.cc and taste a bit of IT!
|
|
|
03-01-2009, 04:21 PM
|
#11 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: problem with c compiler in linux
You do know that DOS's clear and Linux's clear commands are very different? It might lead to issues based on what one's intending to do. If you want a proper window-like console system, go for ncurses.
__________________
Harsh J
www.harshj.com
|
|
|
03-01-2009, 04:35 PM
|
#12 (permalink)
|
|
Wahahaha~!
Join Date: Dec 2006
Location: Pune/there
Posts: 7,676
|
Re: problem with c compiler in linux
Quote:
Originally Posted by Garbage
Before that, if you are using Ubuntu, then install build-essentials package by doing-
Then you can write your code in vi / gedit / kete as
Code:
vi filename.c
gedit filename.c
kete filename.c

|
What is this Kete...lol
|
|
|
24-01-2009, 09:21 PM
|
#13 (permalink)
|
|
Always confused
Join Date: May 2008
Location: Mandriva Control Center
Posts: 349
|
Re: problem with c compiler in linux
Quote:
Originally Posted by QwertyManiac
You do know that DOS's clear and Linux's clear commands are very different? It might lead to issues based on what one's intending to do. If you want a proper window-like console system, go for ncurses.
|
that depends on the programmers intension dude
__________________
Vamsi Subhash
visit my blog at www.vamsisubhash.co.cc and taste a bit of IT!
|
|
|
24-01-2009, 09:30 PM
|
#14 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: problem with c compiler in linux
Didn't I use the word if? And to use system("clear") is wrong, you may try it out yourself. It would not work as expected on most terminal emulators of Linux.
__________________
Harsh J
www.harshj.com
|
|
|
24-01-2009, 09:54 PM
|
#15 (permalink)
|
|
Sami Hyypiä, LFC legend
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,138
|
Re: problem with c compiler in linux
I think it sucks pretty much that much of new programmers are trained in anything but Turbo C++. 
And to add to that, they are made to use, clrscr(); gets() and void main().
Duh...
And a new programmer doesn't even understand.
@OP:
Look here but some tips:
http://home.att.net/~jackklein/ctips01.html
|
|
|
25-01-2009, 12:13 PM
|
#16 (permalink)
|
|
Always confused
Join Date: May 2008
Location: Mandriva Control Center
Posts: 349
|
Re: problem with c compiler in linux
@qwerty
if it is a problem in other emulators ok ....agreed but i really didn't find any problem with it in my tried distros list.
Have you tried Fedora Eclipse or NetBeans 6.1?
__________________
Vamsi Subhash
visit my blog at www.vamsisubhash.co.cc and taste a bit of IT!
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|