LinuxQuestions.org
Help answer threads with 0 replies.
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 02-24-2005, 06:09 AM   #16
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46

Quote:
Originally posted by elluva
try 'g++ -o test test.cpp'
or g++ -v -o test test.cpp. really would like to see the verbose output so it shows exactly what it's linking or what's not found.
 
Old 02-24-2005, 06:52 AM   #17
elluva
Member
 
Registered: Aug 2003
Location: Belguim, Ostend and Ghent
Distribution: Ubuntu
Posts: 600

Rep: Reputation: 30
Quote:
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.
 
Old 02-24-2005, 09:50 PM   #18
abirami
Member
 
Registered: Aug 2004
Posts: 47

Original Poster
Rep: Reputation: 15
sorry , i didnot understand about the distro you are asking for, can you be more clear with question
 
Old 02-24-2005, 09:53 PM   #19
abirami
Member
 
Registered: Aug 2004
Posts: 47

Original Poster
Rep: Reputation: 15
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

Last edited by abirami; 02-24-2005 at 09:57 PM.
 
Old 02-25-2005, 05:33 AM   #20
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
Quote:
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).

Last edited by __J; 02-25-2005 at 05:44 AM.
 
Old 02-25-2005, 06:08 AM   #21
abirami
Member
 
Registered: Aug 2004
Posts: 47

Original Poster
Rep: Reputation: 15
my distro is redhat
well i don't libstdc++ in /usr/local/lib
where as it is in /usr/lib whose path is included in /etc/ld.so.conf

ls /usr/lib | grep libstdc++
libstdc++-2-libc6.1-1-2.9.0.so
libstdc++-3-libc6.2-2-2.10.0.a
libstdc++-3-libc6.2-2-2.10.0.so
libstdc++-libc6.1-1.so.2
libstdc++-libc6.2-2.a.3
libstdc++-libc6.2-2.so.3
libstdc++.so
libstdc++.so.2.7.2
libstdc++.so.2.7.2.8
libstdc++.so.2.8
libstdc++.so.2.8.0
libstdc++.so.2.9
libstdc++.so.2.9.dummy
libstdc++.so.5
libstdc++.so.5.0.3

i don't understand exactly how to fix this bug
pl. help me
and thanx for ur patience to trying to solve my problem
 
Old 02-25-2005, 06:14 AM   #22
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
did you compile another compiler and install it???
 
Old 02-25-2005, 06:27 AM   #23
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
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.
 
Old 02-27-2005, 09:46 PM   #24
abirami
Member
 
Registered: Aug 2004
Posts: 47

Original Poster
Rep: Reputation: 15
Great!!! your suggestions worked out
i really wasted complete 3 days

Thanks , thanks a lot
my program is configured without any error
 
Old 05-24-2006, 01:13 PM   #25
SpetzNatz
LQ Newbie
 
Registered: May 2006
Posts: 1

Rep: Reputation: 0
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 ***

plz need some help here..... thnx!!!
 
Old 05-24-2006, 10:52 PM   #26
abirami
Member
 
Registered: Aug 2004
Posts: 47

Original Poster
Rep: Reputation: 15
try these 2 steps.........

export CC=/usr/bin/gcc

export CXX=/usr/bin/g++

and reconfigure your program
 
Old 01-22-2008, 07:37 AM   #27
saithn
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
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
 
Old 01-22-2008, 05:33 PM   #28
saithn
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
Shameless bump for great justice!
 
Old 01-23-2008, 11:35 AM   #29
saithn
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
One more try, help please

http://xochitl.matem.unam.mx/~canek/...shrek2-cat.png
 
  


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
configure: error: C++ compiler cannot create executables dicou Linux - Newbie 19 06-22-2017 04:17 PM
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
configure: error: C compiler cannot create executables watashiwaotaku7 Linux - General 7 10-22-2009 09:40 AM
configure: error: C compiler cannot create executables strimp099 Linux - Software 2 07-11-2005 07:23 PM
Problem with gcc: configure: error: C compiler cannot create executable abefroman SUSE / openSUSE 4 05-11-2005 06:12 PM

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

All times are GMT -5. The time now is 03:59 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