Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6666607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:50:47+00:00 2026-05-26T02:50:47+00:00

after building the shared librrary using gcc, the shared library builds fine, but when

  • 0

after building the shared librrary using gcc, the shared library builds fine, but when i issue “ldd” it give me the dependency on “libstdc++.so.5” is there any way to tell the compiler to igonre gcc so file dependency

# ldd libtest.so 
            libstdc++.so.5 =>        /opt/gcc/libstdc++.so.5
            libsocket.so.1 =>        /lib/libsocket.so.1
            libnsl.so.1 =>   /lib/libnsl.so.1
            libc.so.1 =>     /lib/libc.so.1
            libmp.so.2 =>    /lib/libmp.so.2
            libmd.so.1 =>    /lib/libmd.so.1
            libscf.so.1 =>   /lib/libscf.so.1
            libdoor.so.1 =>  /lib/libdoor.so.1
            libuutil.so.1 =>         /lib/libuutil.so.1
            libgen.so.1 =>   /lib/libgen.so.1
            libm.so.2 =>     /lib/libm.so.2
            /platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1
            /platform/SUNW,SPARC-Enterprise-T5220/lib/libmd_psr.so.1

What compiler optiion i should give that will ignore the dependecies like “libstdc++.so.5” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:50:47+00:00Added an answer on May 26, 2026 at 2:50 am

    after building the shared librrary using gcc, the shared library builds fine, but when i issue “ldd” it give me the dependency on “libstdc++.so.5”

    gcc doesn’t automatically link libstdc++, g++ does. So, either you are linking with g++ or you pass -lstdc++ linker option.

    You have a few options:

    • Build and link with gcc, not g++, to make sure libstdc++ doesn’t get linked in automatically. Don’t pass -lstdc++ linker option. Obviously, this only works with C code.
    • Build and link with g++ and link libstdc++ statically by using -static-libstdc++ link stage option.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Boost library in Linux, GCC. After installing and building the
In have my application configured in asp.net. I am using ajaxcontroltoolkit. After building the
I'm currently building a web form using APEX that is losely modelled after a
I'm building a shared library in C, which other programs use. Sometimes, these other
I am using Maven 3 for build Dashboard project After building my web application
After building a filepath ( path , below) in a string (I am aware
After building the application GUI, I realised it was a little bit too complex
after successfully building my application the start fails because it relies on config files
I'm building a product that will ship after .Net 4.0 is released. Is MEF
I've been building an error logging app recently and was after a way of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.