Results 1 to 10 of 10
Hi,
I am trying to do C programming in linux. The default shell I use is bash.
Is there a shell to do C programming?
This is because when i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-27-2003 #1Just Joined!
- Join Date
- Mar 2003
- Posts
- 25
How to program in C in linux?
Hi,
I am trying to do C programming in linux. The default shell I use is bash.
Is there a shell to do C programming?
This is because when i type 'gcc -ansi hello.c -o hello.c' , there is an error message saying that the command is not found.
What command should I type to get to the correct shell ?
- 07-27-2003 #2Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
1. There is no certain shell that you have to use to compile programs in C
2. You need to check if gcc is installed on your system. To do that, run 'which gcc'. If it gives you a full path name, then you have it installed.
3. Your command 'gcc -ansi hello.c -o hello.c' is wrong.
a. Your option '-o hello.c' should be something like '-o hello.exe' With the command you are using, you are trying to compile the source code file 'hello.c' into your executable. That's just plainly wrong.
b. I believe you need to specify all options BEFORE the source file name. Hence, you can try something like 'gcc -ansi -o hello.exe hello.c'. Note that the order is different than your code.
4. You can type 'ps' to see the processes that you are currently running. It will show the shell that you are currently in.The best things in life are free.
- 07-27-2003 #3Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Like bpark said, you probably just don't have gcc installed; most distributions don't install it by default. Just pop in your distribution CD and install it, and you should be fine.
- 09-14-2003 #4Just Joined!
- Join Date
- Aug 2003
- Location
- Ohio
- Posts
- 25
i have the same prob, but when i put my cd in to install it says that i need to update my sources...i try it(updating) and same thing happens
- 09-14-2003 #5Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
What distribution?
- 09-15-2003 #6Just Joined!
- Join Date
- Aug 2003
- Location
- Ohio
- Posts
- 25
i have mandrake 9.0 and it just won't let me install a gcc
- 09-15-2003 #7Just Joined!
- Join Date
- Jun 2003
- Location
- Helsinki, Finland
- Posts
- 78
Are you installing as the root user or as a normal user?
- 09-15-2003 #8Linux User
- Join Date
- Feb 2003
- Location
- Norway, Asker
- Posts
- 267
just "urpmi gcc" and I think it should install gcc
- 09-17-2003 #9Just Joined!
- Join Date
- Aug 2003
- Location
- Ohio
- Posts
- 25
i tried installing first as normal user then as root neither of them worked i received the "installation error" for both
- 09-17-2003 #10Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
What method are you using to install it, and exactly what error message do you get?


Reply With Quote
