LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   can't install g++ so I can't compile and install any programs (https://www.linuxquestions.org/questions/linux-software-2/cant-install-g-so-i-cant-compile-and-install-any-programs-353590/)

musicmaniac414 08-15-2005 04:43 PM

can't install g++ so I can't compile and install any programs
 
I'm trying to install Python 2.4.1 on Fedora 4 linux. I downloaded and unzipped the files. I then tried to ./configure, but there was a problem with the gcc. I configured the gcc, but now when I type ./configure, I get this message

[benjamin@dhcppc0 Python-2.4.1]$ ./configure
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for --with-cxx=<compiler>... no
checking for c++... no
checking for g++... no
checking for gcc... gcc
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.

It appears my problem is I don't have c++ or g++. Is that my only issue? If so, how do I install these two compilers? Any help is appreciated, as I'm new to this.

joelkeeble 08-15-2005 05:23 PM

print the output of config.log lst 10 lines should be fine. :)

musicmaniac414 08-15-2005 05:34 PM

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by python configure 2.4, which was
generated by GNU Autoconf 2.59. Invocation command line was

$ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = dhcppc0
uname -m = i686
uname -r = 2.6.11-1.1369_FC4
uname -s = Linux
uname -v = #1 Thu Jun 2 22:55:56 EDT 2005

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/kerberos/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/X11R6/bin
PATH: /home/benjamin/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1444: checking MACHDEP
configure:1578: result: linux2
configure:1584: checking EXTRAPLATDIR
configure:1599: result:
configure:1618: checking for --without-gcc
configure:1667: result: no
configure:1673: checking for --with-cxx=<compiler>
configure:1694: result: no
configure:1713: checking for c++
configure:1742: result: no
configure:1713: checking for g++
configure:1742: result: no
configure:1713: checking for gcc
configure:1729: found /usr/bin/gcc
configure:1739: result: gcc
configure:1779: checking for C++ compiler default output file name
configure:1782: gcc conftest.cc >&5
gcc: installation problem, cannot exec 'cc1plus': No such file or directory
configure:1785: $? = 1
configure: failed program was:

If you need more I can email it to you. Thanks for your help!

joelkeeble 08-15-2005 05:48 PM

do a:

"which gcc"

if it returns a path then check that the path is in your path:

"echo $PATH"

if not add it

"PATH=$PATH:/usr/bin/gcc"
Try running ./configure again

if which doesnt return anyting do a find to check it is on the system
"find / -name gcc"

might take a while if it returns nothing then you need to install it, howerver it is unlikley that you dont have gcc every distro iv'e used comes with it, unless you built your own and in that case you would have struggled to compile progs.

if you do find it add a soft link to /usr/bin

"ln -s /wherever/it/is/gcc /usr/bin/gcc"

The run configure agian. if your still having probs let me know :)

musicmaniac414 08-15-2005 09:01 PM

Okay, here's what happened. gcc wasn't in my path. I added it, but ./configure still won't run. Look at this:

[benjamin@dhcppc0 Python-2.4.1]$ which gcc
/usr/bin/gcc
[benjamin@dhcppc0 Python-2.4.1]$ ./configure
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for --with-cxx=<compiler>... no
checking for c++... no
checking for g++... no
checking for gcc... gcc
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.

Here's the latest log

configure:1444: checking MACHDEP
configure:1578: result: linux2
configure:1584: checking EXTRAPLATDIR
configure:1599: result:
configure:1618: checking for --without-gcc
configure:1667: result: no
configure:1673: checking for --with-cxx=<compiler>
configure:1694: result: no
configure:1713: checking for c++
configure:1742: result: no
configure:1713: checking for g++
configure:1742: result: no
configure:1713: checking for gcc
configure:1729: found /usr/bin/gcc
configure:1739: result: gcc
configure:1779: checking for C++ compiler default output file name
configure:1782: gcc conftest.cc >&5
gcc: installation problem, cannot exec 'cc1plus': Not a directory
configure:1785: $? = 1
configure: failed program was:

musicmaniac414 08-17-2005 03:22 PM

Fixed it. Just logged in as root and typed

#yum install gcc-c++

Thanks for all the help!

reddazz 08-18-2005 03:13 AM

How about just using the FC4 python packages?

Ardor 09-18-2005 01:10 PM

I have the same problem, but with RedHat 9.0
the error message is the same as well
the "yum install" code does not work

joelkeeble 09-18-2005 01:51 PM

What happens when you type "gcc" in the terminal?

Nylex 09-18-2005 11:54 PM

Quote:

Originally posted by Ardor
I have the same problem, but with RedHat 9.0
the error message is the same as well
the "yum install" code does not work

Red Hat 9 doesn't come with yum, that's why you can't use it. You should have the packages you need available on your CDs. I know there's a thing in RH9 similar to Windows' Add/Remove Programs. It has different categories, like "Development tools", "Server", etc. If you can find it (I can't remember where it is, just have a look around the menus you have), look under "Development tools" and it should let you install gcc and other packages from your CDs there.

gutsy 02-06-2008 05:38 PM

g++ help
 
Hi,
I have a similar problem. I can't install, by manual, programs with the
command "./configure". My System is Ubuntu 7.10 Gutsy Gibbon.


xxx@xxx-desktop:~/Spiele/OTTD-source-nightly-r11814$ ./configure
checking awk... awk
checking build system type... i486-linux-gnu
checking host system type... i486-linux-gnu
detecting OS... UNIX
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++ not found
I couldn't detect any g++ binary on your system
please define the CC/CXX environment to where it is located
xxx@xxx-desktop:~/Spiele/OTTD-source-nightly-r11814$


I tryied to install g++, but I can't:

It want even more packages. The last is libc6-dev
but this needs libc6 (= 2.6.1-1ubuntu9).

My system wants to install 2.6.1-1ubuntu10.
So I can't install it.

Has anyone an idee what's going on???

AceofSpades19 02-06-2008 06:16 PM

Quote:

Originally Posted by Ardor (Post 1858562)
I have the same problem, but with RedHat 9.0
the error message is the same as well
the "yum install" code does not work

Red Hat 9 is unsupported as of 2004, unless you have some special reason why you must use RH 9, you should either go to CentOS(free version of Red Hat Enterprise Linux), RHEL(Enterpise version of what is now Fedora), or Fedora which is another free Red Hat based distro

JivanAmara 02-06-2008 09:31 PM

Re: configure fails to find g++.
 
Quote:

Originally Posted by gutsy (Post 3048437)
Hi,
I have a similar problem. I can't install, by manual, programs with the
command "./configure". My System is Ubuntu 7.10 Gutsy Gibbon.
[snip]
I couldn't detect any g++ binary on your system
please define the CC/CXX environment to where it is located
[snip]

Have you read/followed post #4 above?


All times are GMT -5. The time now is 03:04 PM.