LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PATH problem (https://www.linuxquestions.org/questions/linux-newbie-8/path-problem-85015/)

jhansman 08-23-2003 08:35 PM

PATH problem
 
I'm following directions for compiling and making a printer driver from source files (never did THAT in Windows!), and all goes well until I issue the './configure' command. When I do, the first few lines appear OK, then this shows up:

checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH

Now, I know gcc is on the system, 'cause I found it using locate, but now what? Do I need to edit my PATH to include the gcc folder in it, or what? The folder all the to-be-compiled files are in the folder /HOME/JEFF/HPIJS-1.4 , so how do I get the compiler and these bad boys together? TIA!

leonscape 08-23-2003 08:41 PM

Wheres gcc? Usually its /bin or /usr/bin

Type $PATH at the command prompt to list what paths the configure script is searching. I get

/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin

You can add Directories to the PATH with the command

export PATH=$PATH:/your/new/path

But it sounds as if your gcc has been installed to the wrong place.

tyler0123 08-23-2003 09:04 PM

if you want you can set a symbolic link to gcc. just link th edirectory where it is to the directory you need it in. if you decide to do that let me know and i will try to help you. like in mandrake sometimes the rpms look for a path unique to mandrake. i set links to the programs location on my redhat system and things seemed fine.

jhansman 08-23-2003 10:07 PM

OK, logged in as root (su), and cd to the folder with the files I want to compile. Did 'locate' to find gcc, which is in the /usr/bin folder. Checked the path to verify that /usr/bin is in fact in it. Ran ./configure again, and got the same message. Does this make sense? gcc296 is there in /usr/bin, so shouldn't 'configure' find it and use it however it needs to? Suffering major newbie confusion here.....

BTW, using RH9. Nice to work with an OS that presents some challenges :cool:

leonscape 08-23-2003 10:21 PM

Me too, do you have a symlink from gcc to the current version of gcc.

type:
Code:

ls -l /usr/bin/gcc*
This should produce something like
Code:

lrwxrwxrwx    1 root    root            7 Aug 18 07:21 gcc -> gcc-3.3
-rwxr-xr-x    1 root    root        74088 Mar 17 23:16 gcc-2.95
-rwxr-xr-x    1 root    root        74056 Apr  8  2002 gcc-3.0
-rwxr-xr-x    1 root    root        80716 Jul 26 14:56 gcc-3.2
-rwxr-xr-x    1 root    root        80652 Aug 15 07:11 gcc-3.3
lrwxrwxrwx    1 root    root          10 Aug 18 07:21 gccbug -> gccbug-3.3
-rwxr-xr-x    1 root    root        15647 Apr  8  2002 gccbug-3.0
-rwxr-xr-x    1 root    root        15886 Jul 26 13:40 gccbug-3.2
-rwxr-xr-x    1 root    root        16006 Aug 15 07:05 gccbug-3.3

The top one is the most important.

jhansman 08-23-2003 10:29 PM

Here's what I get when I type that in:

[jeff@localhost jeff]$ ls -l /usr/bin/gcc*
-rwxr-xr-x 2 root root 81864 Feb 11 2003 /usr/bin/gcc296


And, this means what?

And, what in God's name is a 'symlink'?

leonscape 08-23-2003 10:47 PM

We've found your problem :)

Symlink is a way of linking a filename or directory name to another.

There is diffrent versions of gcc, as you can see I've got a few installed as it is, So programs just call gcc. the symlink then points the computer towards the correct version. becauase you don't have that symlink we'll have to create it.

su to root and type:
Code:

cd /usr/bin
ln -s gcc gcc296
ls -l gcc*

You should get back a new line with gcc -> gcc296 on the end.

Everthing should work now.

jhansman 08-23-2003 10:55 PM

Sorry, not quite (I think). What I get back is:

ln: `gcc296': File exists

Which squares with what I get when I locate gcc*. gcc296 is sitting in /usr/bin

Is it that this version of the compiler can't handle the job, or what?
Among other things that show up in gcc* locate is this:

/usr/lib/gcc-lib/i386-redhat-linux/3.2.2

Is this a reference to a newer version of gcc on the system, and if so, how to find it?

leonscape 08-23-2003 10:59 PM

Sorry I got the command options the wrong way round. (I'm always doing that!)

ln -s gcc296 gcc

Should of been the command.

---
I think thats the glibc lib, Although it usually match's the version of gcc.

Once you've done the above try

gcc -v

jhansman 08-23-2003 11:22 PM

Well, partial success. The configure worked, but the make didn't. I'm doubting whether this all will work. I may just have to live without the HP printer on RH. Thanks to leonscape for getting me as far as he did!

leonscape 08-23-2003 11:24 PM

Which printer?

I've got a HP Deskjet 3822 all set up and working correctly so I could try and help you through it.

jhansman 08-23-2003 11:38 PM

leonscape, if you want to give it a shot, here's the URL with all the HP OpenSource driver info:

http://hpinkjet.sourceforge.net/install.php

Let me know if you have any more success than I did.

leonscape 08-23-2003 11:47 PM

1) remove LPRng:

rpm -e LPRng redhat-config-printer redhat-config-printer-gui

2) install cups, cups-drivers, cups-drivers-hpijs, gimp-print-cups

up2date -i cups cups-drivers cups-drivers-hpijs gimp-print-cups

3) start cups:

/sbin/service cups start
/sbin/chkconfig cups on

4) point your web browser to http://localhost:631
Click on "Printers" and then "Add Printer", login with the root password
and follow the configuration menus.

This is rather than compiling hpijs your self.

yurlittlepony 08-24-2003 12:17 AM

Sorry to bust in, but I'm having the same *@!# problem.

I'm running SuSE 8.1 and did not have gcc installed correctly as far as I can tell. I downloaded version gcc-3.3.1 and ran the tar gcc-3.3.1.tar.gz command in my /usr/bin directory to unpack it all.

My problem is, when I run:

ls -l /user/bin/gcc*

I get a laundry list of files, not just files starting with gcc.

I can't seem to nail down where the compiler executable is located for linking for running the Samba config command.

Any ideas?

leonscape 08-24-2003 12:43 AM

Try which gcc

yurlittlepony 08-24-2003 12:59 AM

Well, I'll fess up to the fact that I'm an idiot at this.

I can't find an executable. I ran "tar xvfz gcc-3.3.1.tar.gz" and it dumped all of the files into the /usr/bin/gcc-3.3.1/ directory, which includes a /gcc-3.3.1/gcc directory, but no gcc executable as far as I can tell.

I've added PATHS to both directories in the blind hope that I'm missing something, and when I run ./configure I still get

checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

This may not be something you can tell, but am I missing some key files? There's a ton of files in the /usr/bin/gcc-3.3.1. and /usr/bin/gcc-3.3.1/gcc, but no gcc executable as far as I can tell.

leonscape 08-24-2003 01:06 AM

The best thing to do would be to install a version of gcc from binary rpms first. Also chek around a package may already exist. gcc can boot strap it self to compile, but your into diffcult territory, its not something I'd look forward too.

yurlittlepony 08-24-2003 01:13 AM

Ahhh, shit. So basically you're saying I need a compiler to set up the compiler.

Yeah, doesn't sound like fun. Maybe the best thing to do is get my SuSe disks back and run it off the CD.

Thanks for the input.

leonscape 08-24-2003 01:15 AM

Try here for suse 3.3 packages

http://sdb.suse.de/en/sdb/html/gcc33_release.html

Hope this helps.


All times are GMT -5. The time now is 03:19 AM.