LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-13-2003, 01:51 AM   #1
mjkramer
Member
 
Registered: Sep 2003
Location: Orem, Ut
Distribution: Mandrake-9
Posts: 48

Rep: Reputation: 15
Gcc Compiler Problem


Hey, this problem just keeps manifestinig itself in many forms from several levels. I keep posting my findings with the problem but am only getting a few replies out of about 200 views. I really need help, this just isnt making sense to me. Maybe I have no idea what Im doing, either way, im loosing my patience.

The problem is that when I try to compile source files it says it can't find my compiler (nor can I). I tried the command $whereis / gcc and got a list of about 30 different locations. Im too new at using linux to even begin guessing the path I need to include in $PATH (I think the object is to put the executable gcc program into $path once its located, but I don't know).

So then I tried to install the gcc packages from the distro installation disk but got the response that 'the packages were already installed'.

OK, let's recap and summerize here. gcc cannot be located during ./configure. I look for gcc and find 30 possible locations. I try to reinstall gcc but am denied because gcc is already installed. The problem, gcc is installed but cannot be located by whatever system is calling it with the ./configure process.

Maybe I dont have the proper gcc packages. I only found two on my linux installation disk. They are:

gcc-cpp-3.2.2-3mdk.i586.rpm
gcc2.96-cpp-2.96-0.82mdk.i586.rpm
 
Old 10-13-2003, 02:10 AM   #2
mjkramer
Member
 
Registered: Sep 2003
Location: Orem, Ut
Distribution: Mandrake-9
Posts: 48

Original Poster
Rep: Reputation: 15
Im gonna start breakin shit! Nobody has any ideas?!!!!
Im not the only one that should stick to the newbie section then.

Ive been trying to figure this out since 11:00 yesterday morning. Its now 1:14 the next morning.

PHUK!

I cant do this anymore tonight. Im gonna crash. Maybe the Linux fairy will stop by and leave the magic solution while im sleeping.

Last edited by mjkramer; 10-13-2003 at 02:21 AM.
 
Old 10-13-2003, 02:28 AM   #3
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Type which gcc. If gcc is the name of an available executable (in the path somewhere) the location of the file will be returned.

But yes, I see you have your gcc packages installed. Go to /usr/bin and do an ls -l | grep gcc to see what's what and what's not. Files in this directory can be executed from anywhere on the file system, so if you have a file called only "gcc" here and you can't execute it you probably have a problem with your $PATH, like you said.

Do an echo $PATH and look at the list returned. The directories are colon-separated (a ":" between different paths), and /usr/bin should be in there.

If you do NOT have a file called simply gcc in /usr/bin I suggest you symlink one of the available gcc compilers to it - you probably have gcc-2.95 and gcc-3.2 there. I don't run Mandrake so I'm not familiar with the naming conventions used. Anyhow, if you want the 3.2.2 release to be used as standard gcc (to compile most programs) simply create a symlink to it - example below. I assume the dir is /usr/bin and the installed 3.* compiler executable is called gcc-3.2.

$ cd /usr/bin
$ su
<enter root password>
# ln -s gcc-3.2 gcc
# exit
$ which gcc


hw
 
Old 10-13-2003, 02:29 AM   #4
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
The $ indicates a regular user prompt and the # is the root prompt. In other words: Don't type 'em out.

hw
 
Old 10-13-2003, 03:11 PM   #5
mjkramer
Member
 
Registered: Sep 2003
Location: Orem, Ut
Distribution: Mandrake-9
Posts: 48

Original Poster
Rep: Reputation: 15
This is exactly the point. At some point I already looked for it in usr/bin and there is no exectable called gcc there or anything that even clostly guggests gcc. Also, just for kicks, I ran your commands and the ls -l|grep gcc gave me nothing and the 'In' command was not recoginized.

My path does include usr/bin so it is looking there. The only idea I have is that the compiler is in a totally off the wall location. If this is the case, I can't imagine being able to locate it.

Would there be any way to try to install them again and be denied because "package is already installed" but weed through the computers process of determining that and maybe find the location it has listed for it? Of course the only listings it could possibly have is in $PATH. I guess i could manually search through every location listed in $PATH for anything that remotely resembles gcc or a compiler. though my knowledge of naming conventions for this would be minimal. That sounds fun! I know, im digging here.

Could the compuer think its installed, even though it isn't? If so, is there any way to force a re-installation? Just incase this might help (hopefully this means more to you then me), this is what I get when I try to run any ./configure file-

./configure for gcc package:

Configuring for a i686-pc-linux-gnuoldld host.
Created "Makefile" in home/username/gcc/gcc-3.3.1 using "mt-frag"
./configure : line 8: cc: command not found.
****The command 'cc -o conftest -g conftest.c' failed.
****You must set the environment variable CC to a working compiler.

Last edited by mjkramer; 10-13-2003 at 03:38 PM.
 
Old 10-13-2003, 04:56 PM   #6
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Quote:
Originally posted by mjkramer
and the 'In' command was not recoginized.
It's l, as in lowercase L, not an uppercase i.

If you have an /opt directory it may be worth looking there. It is possible (although I won't say probable) that you have a bin directory under it where the executables hide. If you don't find it there, we'll have to whip out the heavy weaponry: find.

This can take all day if you have a slow hard disk, but it's worth a shot. First cd to /opt and then type: find . -name gcc*
This will search all files in the current directory and recursively through the subdirs and list all files that begin with "gcc".
If you don't find it there, go to the /usr dir and repeat the same command. I really do hope you find it because I'm quickly running out of suggestions here. LOL

I haven't used RPM-based distros in a while and I never were that good with them, so I think I'll pass on trying to answer your questions. But do try a man rpm. I think there should be some switch you could use to list the files a package would install (something along the lines of rpm --list packagename.rpm, although I'm sure it's not that simple ).

hw
 
Old 10-24-2003, 08:48 PM   #7
WannaLearnLinux
Member
 
Registered: May 2003
Location: California
Distribution: Slax
Posts: 262

Rep: Reputation: 31
same problem

sorry I'm using this post,but i have same problem and i searched and found this one close to my problem.

And I'm newbie also.MDK 9.1.

So I typed:

[wannalearnlinux@localhost wannalearnlinux]$ which gcc
which: no gcc in (/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/home/wannalearnlinux/bin)

Sorry (for someone) stupid question,but :

Does it mean that there is no Gcc installed?

Looks like it isnot installed to me,just for sure.
Because I need Gcc for Chkrootkit,and when I try install Chkrottkit it says soemthing like "gcc: can't found command" .
I posted it and was helped I need Gcc,which I thought I had installed,but probably didn't.

Please sorry I'm newbie at Linux (MDK 9.1).

Thanx for reading,

WannaLearnLinux
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fortran compiler gcc-g77 installation problem refp16 Linux - Software 6 11-26-2005 12:49 PM
How do I fix this assignment problem C++ compiler error in GCC? Erik_the_Red Programming 4 07-12-2005 09:36 AM
Problem with gcc: configure: error: C compiler cannot create executable abefroman SUSE / openSUSE 4 05-11-2005 06:12 PM
GCC compiler .. pashupathinath Programming 1 10-21-2004 12:20 PM
gcc compiler install problem mla Linux - Software 4 10-11-2003 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration