LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-06-2015, 10:17 AM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Rep: Reputation: 30
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,
 
Old 10-06-2015, 10:39 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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 )



-

Last edited by knudfl; 10-06-2015 at 10:41 AM.
 
Old 10-06-2015, 12:24 PM   #3
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
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,
 
Old 10-06-2015, 12:31 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
*


? Which software is it that "cannot find -lstdc++" ?
 
Old 10-06-2015, 01:05 PM   #5
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
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.
 
Old 10-06-2015, 01:15 PM   #6
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
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
 
Old 10-06-2015, 01:44 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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



-

Last edited by knudfl; 10-07-2015 at 04:29 AM.
 
Old 10-08-2015, 06:06 PM   #8
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
Thank you so much. the dnf provides command is a life savior!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/usr/bin/ld: cannot find -lstdc++ mahmoodn Linux - General 6 08-08-2011 04:32 AM
/tools/bin/ld: cannot find -lstdc++ -- Error in " make check " of Glibc lfs_rocks Linux From Scratch 1 02-15-2008 09:23 AM
linker error: ld: cannot find -lstdc++ ofanan Linux - Software 0 02-08-2006 12:38 PM
qt compile cannot find lstdc++ poboy975 Linux - Software 3 01-08-2005 01:03 PM
Installing Iperf >>cannot find -lstdc++!!!! RKris Linux - Software 1 12-16-2002 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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