-lstdc++ means to include the file "libstdc++".  If you see something like
-L it means to include that directory in the search path for libraries.  I
think you may be able to fix your problem by locating where the libstdc++
files are.  From what you wrote I'm guessing they are in /usr/local/lib.
You might want to try creating a symbolic link in /usr/lib to the
/usr/local/lib/libstdc++.so file.  I might have the file name incorrect,
there may be a version name associated with it too.

After you create this link you may need to create a second symbolic link,
I've noticed that for GCC 3.0.2 I need a link for a file called libgcc_j.so,
the name may be a little different, but it's something like this.  For GCC
2.95.2 I did not need this second link.

When I install GCC from source I generally give configure a
"--prefix=/usr/local/gcc-X.XX" option so I know for sure where all the GCC
files go.  I also specify "--enable-shared" and "--enable-threads=posix".
Did you specify these options.  If you didn't specify the "--enable-shared"
then my previous instructions will need to be modified a little to reference
libstdc++.a and not the shared library version.

If you did enable shared libraries I believe you could also modify
/etc/ld.so.conf and add /usr/local/gcc-x.xx/libs and re-run ldconfig.  This
should then include the gcc libs into your search path for libraries.   I
think this might be a cleaner solution.

As far as the locale.lo thing you did, I don't know much about this, but my
gut feeling is that it's a hack which will not fix your problem.



-----Original Message-----
From: matt braverman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 7:49 PM
To: [EMAIL PROTECTED]
Subject: gcc problem


i am pretty new at redhat and at posting to groups, so please forgive
any irrelevant information i add or improper posting etiquette.  i have
Redhat 8.0, kernel 2.4.18-18.8.0, sony vaio laptop with winME on first
partition, winXP on second, and redhat on third.  
my big problem is this:  

/root/SDL-1.2.5> g++ hello.C -o hello
cannot find -lstdc++    
ld returned 1 exit status

this is a simple hello world program that i got off the internet (not
being prolific in c++ but i just wanted a quick example).  originally i
had gcc rpm's installed and i got this error.  i then downloaded the
source code gcc-3.2.  i ran make and hit on a strange problem.  i would
error because this file was not present:  

locale.lo

so after browsing the net, someone had a similar problem, and i followed
his/her instructions:

cd /root/gcc-3.2/i686-pc-linux-gnu/libstdc++-v3/src
ls -l locale.lo*  --- this showed a file called localed.loT
cp locale.loT locale.lo

and proceed.  i did this and my make worked correctly, or so it looked
to me.  however, i still received the same error with my hello world
program.  so, back on the net, i started reading up on ld (of which i
know nothing about) and i issued the following command (disregarding all
the words of caution about messing with ld, of course :)

g++ -Wl,--rpath,/usr/local/lib

so now, my hello world program gives me this:

/root/SDL-1.2.5> g++ hello.C -o hello

-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to