LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't install gcc because I don't have a C compiler !? (https://www.linuxquestions.org/questions/linux-software-2/cant-install-gcc-because-i-dont-have-a-c-compiler-751776/)

the182guy 09-01-2009 07:47 AM

Can't install gcc because I don't have a C compiler !?
 
Hi all,

I'm using a CentOS dedicated server via SSH. I tired to install a newer version of PHP on it but it failed on the ./configure command because I don't have a compiler.

I figured I need to install gcc, so I downloaded the source and extracted. I tried to run the ./configure command but it failed telling me no acceptable C compiler found in $PATH

I don't understand... I need a C compiler to install the C compiler ?? Here's the output of the configure command for installing gcc

Code:

[root@ds-04648 objdir]# ../gcc-4.4.1/configure --prefix=/opt/gcc4
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: in `/ccinstall/gcc/objdir':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Any ideas? All I want is to install gcc so I can install a newer version of PHP.

Thanks in advance!

Nylex 09-01-2009 08:21 AM

Install gcc using your distro's package management system (which provides pre-built packages, so no compiler is needed). You may have to install other packages too.

MensaWater 09-01-2009 08:43 AM

Quote:

Originally Posted by Nylex (Post 3665329)
Install gcc using your distro's package management system (which provides pre-built packages, so no compiler is needed). You may have to install other packages too.

CentOS uses yum and rpm.

Run "rpm -q gcc" to verify it isn't already installed. If it isn't then run: "yum install gcc".

If it is installed you may simply have a path issue.

Running "rpm -ql gcc" will show you all the files installed by gcc package including the gcc comand itself. make sure the path to that is in your PATH variable.

ongte 09-01-2009 08:48 AM

If you plan on compiling software, you'll probably need more than just GCC.
I'd suggest you do:
# yum groupinstall "Development Tools"

the182guy 09-01-2009 09:35 AM

Thanks guys I did what you suggested. I now get further but still hitting a wall.

When I run my PHP configure comman I get this error:


checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
configure: error: DBA: Could not find necessary header file(s).


I have installed the gdbm package by using:

yum install gdbm-devel

But the error still remains. Even when I use --without-gdbm in the configure command I still get this error.

Any ideas?

lazlow 09-01-2009 10:03 AM

Usually the easiest way to build packages on any distro is to see how the packagers built the last version of that software and start from there. Grab the source rpm of the last version of PHP and look at the spec file. It will tell you what patches had to be applied and how to configure things.

Edit: You may also want to tell us which version you are trying to build and why you think you need it.

the182guy 09-02-2009 03:43 PM

Thanks for the help all. I fixed it eventually by removing the --with-db4 my PHP 5.3 install is running nicely now:D


All times are GMT -5. The time now is 09:17 PM.