LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   fedora 22: ld: cannot find -lstdc++ (https://www.linuxquestions.org/questions/fedora-35/fedora-22-ld-cannot-find-lstdc-4175555440/)

djgerbavore 10-06-2015 10:17 AM

fedora 22: ld: cannot find -lstdc++
 
I'm having trouble installing this library. I tried the x86_64 and i686 version and I'm still getting ld:cannot find -lstdc++

I installed:

Code:

dnf install libstdc++-devel
dnf install libstdc++

Code:

dnf install libstdc++-devel.i686
dnf install libstdc++.i686

What am I missing?

Thanks,

knudfl 10-06-2015 10:39 AM

Quote:

ld:cannot find -lstdc++
$ dnf provides */libstdc++.so

# dnf install gcc-c++.x86_84
( Provides /usr/lib/gcc/x86_64-redhat-linux/5.1.1/libstdc++.so )



-

djgerbavore 10-06-2015 12:24 PM

Hey I ran the provides command:
Code:

$ sudo dnf provides */libstdc++.so
Last metadata expiration check performed 2:09:38 ago on Tue Oct  6 10:11:03 2015.
compat-gcc-34-c++-3.4.6-36.fc22.x86_64 : C++ support for compatibility compiler
Repo        : @System

gcc-c++-5.1.1-4.fc22.x86_64 : C++ support for GCC
Repo        : @System

libstdc++-devel-5.1.1-4.fc22.i686 : Header files and libraries for C++ development
Repo        : @System

compat-gcc-34-c++-3.4.6-36.fc22.x86_64 : C++ support for compatibility compiler
Repo        : fedora

gcc-c++-5.1.1-1.fc22.x86_64 : C++ support for GCC
Repo        : fedora

libstdc++-devel-5.1.1-1.fc22.i686 : Header files and libraries for C++ development
Repo        : fedora

gcc-c++-5.1.1-4.fc22.x86_64 : C++ support for GCC
Repo        : updates

libstdc++-devel-5.1.1-4.fc22.i686 : Header files and libraries for C++ development
Repo        : updates

So I tried to install both x86_64 and i686 version of gcc-c++
Code:

$ sudo dnf install gcc-c++.x86_64
Last metadata expiration check performed 2:10:27 ago on Tue Oct  6 10:11:03 2015.
Package gcc-c++-5.1.1-4.fc22.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
[stralko@ca07lp515255 crosstool-ng]$ sudo dnf install gcc-c++.i686
Last metadata expiration check performed 2:10:33 ago on Tue Oct  6 10:11:03 2015.
Package gcc-c++-5.1.1-4.fc22.i686 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

However I'm still getting the same error of
ld -lstdc++
ld: cannot find -lstdc++

Thanks,

knudfl 10-06-2015 12:31 PM

*


? Which software is it that "cannot find -lstdc++" ?

djgerbavore 10-06-2015 01:05 PM

Well this came up from building a cross compile toolchain. I'm using crosstool-ng and was running:
Code:

./ct-ng build
[DEBUG]  Checking that gcc can statically link libstdc++ (CT_CC_GCC_STATIC_LIBSTDCXX)
[DEBUG]    You may need to ensure that libstdc++.a is installed on your system
[DEBUG]    ==> Executing: 'x86_64-build_unknown-linux-gnu-gcc' '-O2' '-g' '-pipe' '/home/stralko/src/embedded-linux-labs/toolchain/crosstool-ng/.build/arm-cortexa5-linux-uclibcgnueabihf/build/test.c' '-static' '-lstdc++' '-o' '/home/stralko/src/embedded-linux-labs/toolchain/crosstool-ng/.build/arm-cortexa5-linux-uclibcgnueabihf/build/.gccout'
[DEBUG]    /usr/bin/ld: cannot find -lstdc++
[ERROR]    collect2: error: ld returned 1 exit status
[ERROR] 
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Checking that gcc can statically link libstdc++ (CT_CC_GCC_STATIC_LIBSTDCXX)'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@554]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      'docs/B - Known issues.txt'
[ERROR] 
[ERROR]  (elapsed: 0:01.60)

But when I try to run this from the command line I can the same error.
Code:

$ ld -lstdc++
ld: cannot find -lstdc++

Thanks for you help.

djgerbavore 10-06-2015 01:15 PM

Sorry I was getting confused I think the issue is the cross compiling is what is having the issues not the host machine.

Here is the command that is error-ing out:
Code:

./x86_64-build_unknown-linux-gnu-gcc \
        -O2 -g -pipe \
        /home/stralko/src/embedded-linux-labs/toolchain/crosstool-ng/.build/arm-cortexa5-linux-uclibcgnueabihf/build/test.c \
        -static -lstdc++ \
        -o /home/stralko/src/embedded-linux-labs/toolchain/crosstool-ng/.build/arm-cortexa5-linux-uclibcgnueabihf/build/.gccout


knudfl 10-06-2015 01:44 PM

Re #5, #6.
Quote:

You may need to ensure that libstdc++.a is installed on your system
Please read post #2 about "dnf provides */<file>".
So why not use 'dnf provides */libstdc++.a' ?

The package libstdc++-static provides /usr/lib/gcc/x86_64-redhat-linux/5.1.1/libstdc++.a



-

djgerbavore 10-08-2015 06:06 PM

Thank you so much. the dnf provides command is a life savior!


All times are GMT -5. The time now is 10:19 PM.