# libstdc++.la: No such file or directory - errors and tips

## yaneurabeya

Just thought I might contribute with a useful post since it seems that for some odd reason the toolchain hardcoded issues aren't going away and maybe this will help solve any given issues at hand. Of course, please refer to kallemej's FAQ since it basically describes all the steps (all 2 of them... har har) to fixing this issue. I hate to rehash this but I think that what the other sticky lacks is perhaps coverage and by inserting keywords I hope to make this thread more searchable than other threads previously were.

Here are the steps for the simplest solution, so GET READY  :Smile: :

 *Quote:*   

> Note the following pattern in a compilation error:
> 
> grep: /usr/lib/gcc/i686-pc-linux-gnu/3.4.3/libstdc++.la: No such file or directory -> /usr/${ERROR_ROOT_DIRECTORY}/${CHOST}/${GCC_VERSION}/libstdc++.la
> 
> What you want to do is run the following command as root with the given pattern as described above: 
> ...

 

If you still have issues (mostly due to a differing architecture, so an error message shows i386-pc-linux-gnu as opposed to i686-pc-linux-gnu for example) and you have already tried kallemej's advice for fixing archs (see FAQ above), make sure that you didn't accidentally mess up your CHOST and CFLAGS variables by choosing an incorrect/inconsistent pair for CHOST and -march or -mcpu. Also make sure that you choose the right stage tarball for the right architecture. See the installation handbook for more details on the proper configuration

Other possible solutions:

1) Try removing ~x86 (or ~amd64 possibly?) if you have added it to your /etc/make.conf file under the ACCEPT_KEYWORDS.

2) Here's a bug report that may apply to you if you emerged the latest gcc 3.4.3 version (currently version 3.4.3.20050110): https://bugs.gentoo.org/show_bug.cgi?id=84324

3) If you have a reoccurring issue with versioning (ie 3.4.3.3.4.3... etc) after running fix_libtool_files.sh, look here for some suggestions on how to remedy your problem: https://forums.gentoo.org/viewtopic-t-279136.html

4) If none of the above apply, please try post feedback on the thread noted below with your emerge --info, the stage tarball that you used, and your architecture.

5) Last resort method!!! If you can't seem to fix it any other way, just symlink the error directory to your actual gcc directory, ie something like...

```
ln -sf /usr/lib/gcc/${CHOST} /usr/${ERROR_ROOT_DIRECTORY}/${CHOST}/${GCC_VERSION}
```

 Just substitute the given values as shown above by the compilation error pattern. I do not suggest this fix and I believe that you should exhaust every other option before doing this since this is like taking painkillers instead of fixing the problem; the painkillers don't solve the issue but just mask the underlying problem. If you didn't get my analogy, all that you're doing is creating a symlink to cover up the underlying problem as opposed to fixing the actual problem, so instead of fixing it once, you are just praying and hoping that the symlink, and hence the error will remain constant throughout all of your compiling so you don't have to add additional symlinks to solve the problem.

Note: You will have to restart your emerge (emerge --resume works well in this case).

Also, some people have reported seeing MUCH longer items than just something like "3.4.3" for example (like full gcc profile names, etc), so using something similar to "gcc-XXXXXXXXXXX" maybe necessary if it shows up in place of "3.4.3" for '${GCC_VERSION}'.

Moreover, if you are one of the people that has issues with a CHOST variable change (ie i386-pc-linux-gnu errors when using a i686-pc-linux-gnu type compiler profile for example), a solution has been offered by dirtyepic which may or may not solve your issue. Please head here for more details: https://forums.gentoo.org/viewtopic-t-321340.html

Tips for toolchain maintanence: As I stated previously in another post, I have very little issues with this and my installation is actually quite stable with the given packages I have (gcc 3.4.3, latest glibc, as well as a number of unstable packages), since I rebuild my toolchain via a bootstrap, then system, and finally rebuild world.

So what I suggest doing when you receive a new version of gcc is to automatically do the above, or like kallemej suggests in his FAQ, but just use your previous compiler version for gcc with fix_libtool_files.sh, and/or use your current version if you upgraded from something like 3.4.3 to 3.4.3-r1 for example, like shown below:

```
fix_libtool_files.sh 3.4.3
```

As silly as it may seem that little -r1 can really cause issues with compiling certain packages if things are hardcoded improperly.

Also, if you upgrade glibc I suggest running

```
/usr/portage/scripts/bootstrap.sh && emerge -e system && emerge -e world
```

since it should decrease the probability of inconsistencies with the glibc upgrade. You can use your favorite toolchain upgrade method in place of the second command, as many people have discovered scripts which will help automate the task for them (see this thread about a script named tcupdate). I know it's a bit redundant but it appears to work for some when other solutions wouldn't.

Good luck and hopefully the compiling with work well for you from now on  :Smile: .

emerges I have seen been affected by this issue (please PM me so I can add more to the list to make it more searchable):

Amarok

avifile

beep-media-player

gcc (emerge --newuse -uD world) # this is due to some flags changing in gcc

gedit

Gnome

GTK

imagemagick

imlib

KDE

PHP

xine-lib

Please post any issues here: https://forums.gentoo.org/viewtopic-p-2269364.html

Revision history

2005.04.10 - Added reference to emerge --newuse world and changing CHOST var.

2005.04.13 - Added CHOST/CFLAGS relevancy reasoning.

2005.04.14 - Changed glibc upgrade suggestion and wording.

2005.04.17 - Added reoccurring version error suggestion and trimmed some lines.

2005.04.18 - Added 'dirty symlink hack' and revised compile error pattern.

2005.04.19 - Grammatical fix and partioned solutions a bit better.Last edited by yaneurabeya on Mon Jun 06, 2005 3:55 am; edited 5 times in total

----------

## fury

Thanks, this worked perfectly!

----------

## yaneurabeya

Please post to the feedback thread next time -_-...

----------

## protokol

i ran:

theeric portage # fix_libtool_files.sh 3.3.5

 * Scanning libtool files for hardcoded gcc library paths...

 *   [1/6] Scanning /lib ...

 *   [2/6] Scanning /usr/lib ...

 *     FIXING: /usr/lib/gstreamer-0.8/libgstmodplug.la ...[]

 *     FIXING: /usr/lib/libSDL.la ...[]

 *   [3/6] Scanning /opt/sun-jdk-1.4.2.08/jre/lib ...

 *   [4/6] Scanning /usr/games/lib ...

 *   [5/6] Scanning /usr/i686-pc-linux-gnu/lib ...

 *   [6/6] Scanning /usr/local/lib ...

i tried emerging gtk+ once again, with the same error:

grep: //usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/libstdc++.la: No such file or directory

/bin/sed: can't read //usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/libstdc++.la: No such file or directory

libtool: link: `//usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/libstdc++.la' is not a valid libtool archive

I'm using stage 2 on x86

emerge --info

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.10-gentoo-r6 i686)

=================================================================

System uname: 2.6.10-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz

Gentoo Base System version 1.4.16

Python:              dev-lang/python-2.3.5 [2.3.5 (#2, Apr 28 2005, 20:29:35)]

dev-lang/python:     2.3.5

sys-apps/sandbox:    [Not Present]

sys-devel/autoconf:  2.13, 2.59-r6

sys-devel/automake:  1.5, 1.9.4, 1.6.3, 1.7.9-r1, 1.4_p6, 1.8.5-r3

sys-devel/binutils:  2.15.92.0.2-r7

sys-devel/libtool:   1.5.16

virtual/os-headers:  2.6.8.1-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 X alsa apm avi bash-completion berkdb bitmap-fonts bonobo cdr crypt cups curl divx4linux dvd eds emboss encode esd fam ffmpeg foomaticdb fortran gd gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile i8x0 imagemagick imlib java joystick jpeg junit libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl nptlonly offensive ogg oggvorbis opengl oss pam pdflib perl png python quicktime readline real samba scanner sdl session spell ssl svga tcltk tcpd theora tiff truetype truetype-fonts type1-fonts usb vorbis xml xml2 xprint xv xvid zlib userland_GNU kernel_linux libc_glibc"

Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

----------

## yaneurabeya

Note //usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5/libstdc++.la ; I have already listed a number of fixes, with the last being possible if you can't see the beforementioned fixes to work.

And please next time _READ_ the documentation more carefully and note the fact that there is a feedback thread for comments such as these. I'm sorry, but I cannot stress this fact enough. So please... do that.

Also, do realize that you changed your CHOST since it's now i686 instead of i386, like the error message claims...

----------

## kompressor

 *yaneurabeya wrote:*   

> 
> 
> 5) Last resort method!!! If you can't seem to fix it any other way, just symlink the error directory to your actual gcc directory, ie something like...
> 
> ```
> ...

 

Can you explain why this should be the last resort?  

How is it not fixing the problem?

----------

## yaneurabeya

 *kompressor wrote:*   

> Can you explain why this should be the last resort?  
> 
> How is it not fixing the problem?

 

Read that section again and next time post to the feedback thread please...

----------

## blackwhite

If fix_libtool_files.sh 3.4.3 does not solve your problem for old version gcc 3.4.3, try this: fix_libtool_files.sh 3.4.3-20050110 

----------

## yaneurabeya

 *blackwhite wrote:*   

> If fix_libtool_files.sh 3.4.3 does not solve your problem for old version gcc 3.4.3, try this: fix_libtool_files.sh 3.4.3-20050110 

 

Yes, blackwhite...

1) That only applies for this release though.

2) Read the freakin instructions on posting please!!! N00BS!

----------

## joaobertacchi

I had a similar problem when I upgrade to gcc 3.3.6.

As discribed in https://forums.gentoo.org/viewtopic-t-370444-view-previous.html?sid=4d9a681fcfaf6490aab531e84bc913e8 fix_libtool_files.sh didn't work.

The sugestion was: rebuild libtool with the new gcc.

```
emerge libtools
```

After that, fix_libtool_files.sh started to work.

----------

## aromero3

If anyone comes across this and still has problems and does not want to have to emerge an older version of gcc, make sure that when you see the error message from libtool make sure to keep in mind any extra suffixes to the version.

If libtool complains: Libtool cannot find library: /usr/lib/gcc-lib/<arch>/<old version>/libstdc++.la

run fix_libtool_files.sh <old version>

I ran what I though was something like 3.3.5 but it was really 3.3.5-20050901 or something like that.

So in the end it was fix_libtool_files.sh 3.3.5-20050901 or something like that

----------

## zonksoft

You should really try this solution posted by teletoby in this thread:

 *teletoby wrote:*   

> 
> 
> - fix_libtool_files.sh 3.3.5 --oldarch i386-pc-linux-gnu
> 
> definitely finds some libtool files (mostly in kde) and fixes them.
> ...

 

I got the error while emerging mod_php and this fixed my problem immediately.

----------

## s.o.l.a.r.i.s

 *joaobertacchi wrote:*   

> I had a similar problem when I upgrade to gcc 3.3.6.
> 
> As discribed in https://forums.gentoo.org/viewtopic-t-370444-view-previous.html?sid=4d9a681fcfaf6490aab531e84bc913e8 fix_libtool_files.sh didn't work.
> 
> The sugestion was: rebuild libtool with the new gcc.
> ...

 

I am also running gcc 3.3.6. I tried your solution but there seems to be no ebuild for libtools *confused*

Chris

----------

## cheecheeo

 *s.o.l.a.r.i.s wrote:*   

> 
> 
> I am also running gcc 3.3.6. I tried your solution but there seems to be no ebuild for libtools *confused*
> 
> Chris

 

Try rebuilding "libtool".

----------

## sutashu

Is fix_libtool_files.sh part of the gcc package? There is no such file in my system  :Sad: 

----------

## eeknay

I have an error that looks like this:

```

grep: /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5-20050130/libstdc++.la: No such file or directory

/bin/sed: can't read /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5-20050130/libstdc++.la: No such file or directory

libtool: link: `/usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.5-20050130/libstdc++.la' is not a valid libtool archive

make[3]: *** [libkio.la] Error 1

make[3]: Leaving directory `/var/tmp/portage/kdelibs-3.5.1-r1/work/kdelibs-3.5.1/kio'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/var/tmp/portage/kdelibs-3.5.1-r1/work/kdelibs-3.5.1/kio'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/kdelibs-3.5.1-r1/work/kdelibs-3.5.1'

make: *** [all] Error 2

```

This happends during rebuilding kdelibs with new use.

As you can see, it asks for gcc-3.3.5 which I don't even have installed considering this:

```

(~) eeknay $ gcc-config -l

 [1] i686-pc-linux-gnu-3.3.6 *

 [2] i686-pc-linux-gnu-3.3.6-hardened

 [3] i686-pc-linux-gnu-3.3.6-hardenednopie

 [4] i686-pc-linux-gnu-3.3.6-hardenednopiessp

 [5] i686-pc-linux-gnu-3.3.6-hardenednossp

 [6] i686-pc-linux-gnu-3.4.5

 [7] i686-pc-linux-gnu-3.4.5-hardened

 [8] i686-pc-linux-gnu-3.4.5-hardenednopie

 [9] i686-pc-linux-gnu-3.4.5-hardenednopiessp

 [10] i686-pc-linux-gnu-3.4.5-hardenednossp

```

So, should I install gcc-3.3.5? But this a can't do, since I don't have any ebuilds for this.

eeknay

----------

## eeknay

also the fix_libtool does not do the trick for me

----------

## dsd

for anyone who hits this bug after upgrading from gcc-4.1.0 to gcc-4.1.0-r1, i have tried to clarify the reasoning why this isn't automated here:

https://bugs.gentoo.org/show_bug.cgi?id=73435#c207

----------

## larrythecow

I'm just confused because I get the error:

grep: /usr/lib/libstdc++.la: No such file or directory

/bin/sed: can't read /usr/lib/libstdc++.la: No such file or directory

libtool: link: `/usr/lib/libstdc++.la' is not a valid libtool archive

It is in a different directory. None of the solutions seem to apply.[/glsa]

----------

## larrythecow

Turns out I just needed to run /usr/portage/scripts/bootstrap.sh    and it worked fine but now when I emerge kdemultimedia-3.5.5 I get:

libtool: link: cannot find the library `/usr/lib/libstdc++.la'

----------

## zoltix

I installed the gcc.4.1.2 and after I can't find libstdc++.la....

Could you please help me to find a solution ?

----------

## reshma

Does the resort grand rivera princess in playa del carmen have internet? Anybody who knows or has stayed there does the new resort Grand Rivera Princess in Playa Del Carmen have free internet access? If it's not free how much is it?

----------

