configure: error: installation or configuration problem: C++ compiler cannot create e
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Originally posted by abirami ...
/usr/bin/ld: cannot find -lstdc++
...
You lack libstdc++ on your system, as I've said before. If you would tell us WHAT DISTRO YOU HAVE, we could check what packages you have to install. It are probable the development versions that you don't have.
Originally posted by abirami This is the output i got for the command
> g++ -v -o test test.cpp
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ../gcc-3.0.1/configure
Thread model: single
gcc version 3.0.1
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ test.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase test.cpp -version -o /tmp/ccJSUe5L.s
GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
ignoring nonexistent directory "/usr/local/include/g++-v3"
ignoring nonexistent directory "/usr/local/include/g++-v3/i686-pc-linux-gnu"
ignoring nonexistent directory "/usr/local/include/g++-v3/backward"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include
/usr/include
End of search list.
as -V -Qy -o /tmp/ccUIJCro.o /tmp/ccJSUe5L.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 2.13.90.0.18 20030206
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o test /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../.. /tmp/ccUIJCro.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/crtend.o /usr/lib/crtn.o
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
First, where did this compiler come from? certainly this is not what came with your system
exactly what are you running? distro refers to distribution of linux. RedHat, Fedora Core, Mandrake, and slackware are all distrobutions of linux, each doing things thier own way. I noticed your gcc is installed in /usr/local so:
in a console do:
ls /usr/local/lib | grep libstdc++
and see if it repeats it back to you ( may be named a little different, the one we're looking for is libstdc++.so.5)
if it does, open ( as root) up a text editor and open /etc/ld.so.conf. make sure the line:
/usr/local/lib
is specified in that file. then (again as root) run:
ldconfig
to cache the libraries and if libstdc++ is in /usr/local/lib that will get rid of the linker not being able to find it ( it'll get rid of the "cannot find -lstdc++" error).
I'm going to assume that you have the compiler that came with your system in /usr/bin ( if not, install it off of your install cd's). to make sure we pick that one up do this:
hi there... i'm having the same problem, i'm using kubuntu, and kdevelop, i'm just trying to run a simple "hello world" source, but i'm getting this error...
cd '/home/spetznatz/prog' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -f Makefile.cvs && cd '/home/spetznatz/prog/debug' && CXXFLAGS="-O0 -g3" "/home/spetznatz/prog/configure" --enable-debug=full && cd '/home/spetznatz/prog/debug/src' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k prog
aclocal
autoheader
automake
autoconf
installing -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for C++ compiler default output file name...
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
*** Exited with status: 77 ***
A big kick. Having kind of the same problem. I first posted this reply on the ubuntu forums, but since this is quite an urgent problem for me, I also post it here.
Hey,
I'm a new Ubuntu user trying to use some tools that need to be build. However, I have problems with the ./configure. I've already read quite some forums for this problem, but I'm still stuck.
I am using ubuntu 7.10
The message I get when trying to configure:
Code:
~/Study/ADK-0.4$ ./configure
loading cache ./config.cache
checking for c++... (cached) c++
) works... nor the C++ compiler (c++
configure: error: installation or configuration problem: C++ compiler cannot create executables.
delodic@Delodic:~/Study/ADK-0.4$
And the Log generated:
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:531: checking for c++
configure:563: checking whether the C++ compiler (c++
) works
configure:579: c++
-o conftest conftest.C 1>&5
eval: 1: c++
: not found
configure: failed program was:
#line 574 "configure"
#include "confdefs.h"
int main(){return(0);}
.
I Assume that my c++ compiler isn't working correctly. Probably missing a package.
Using google, I found "this" topic with someone that has kind of the same problem I think.
So the packages I have, for each I did a sudo apt-get install
Quote:
build-essential is already the newest version.
libc6 is already the newest version.
libstdc++6 is already the newest version.
g++ is already the newest version. g++ set to manual installed.
If I type
Code:
echo 'main(){}' >> test.cpp
And then
Code:
g++ -v test.cpp
I get:
Quote:
~/Study/ADK-0.4$ g++ -v test.cpp
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
/usr/lib/gcc/i486-linux-gnu/4.1.3/cc1plus -quiet -v -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=generic -auxbase test -version -fstack-protector -fstack-protector -o /tmp/cc2zaA20.s
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.1.3
/usr/include/c++/4.1.3/i486-linux-gnu
/usr/include/c++/4.1.3/backward
/usr/local/include
/usr/lib/gcc/i486-linux-gnu/4.1.3/include
/usr/include
End of search list.
GNU C++ version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) (i486-linux-gnu)
compiled by GNU C version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128256
Compiler executable checksum: 3cc47be363985179cfafdceddd0e8f5d
test.cpp: In function ‘int main()’:
test.cpp:2: error: redefinition of ‘int main()’
test.cpp:1: error: ‘int main()’ previously defined here
Here my results are a bit different than in the other topic. Anyway, there was suggested to do the following:
Quote:
I'm going to assume that you have the compiler that came with your system in /usr/bin ( if not, install it off of your install cd's). to make sure we pick that one up do this:
Code:
export CC=/usr/bin/gcc
and
Code:
export CXX=/usr/bin/g++
and try to reconfigure your program again.
When I execute these commands, nothing really happens. I assume there is some problem because I tried to build the g++ myself and later (perhaps?) used the upt-get to install the g++.
I hope this is enough information, and that someone can help me
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.