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 6646031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:21:59+00:00 2026-05-26T00:21:59+00:00

Found this statement over at PSE : (quoting Bob ) One of my favorite

  • 0

Found this statement over at PSE: (quoting Bob)

One of my favorite tricks on Windows and Mac OS doesn’t work on Linux.
That trick is to write a DLL/dylib using C++ internals, export a C
API, and then be able to call into it from C programs. Linux shared
objects (the local equivalent of a DLL) can’t really do that easily,
because the C++ standard library .so isn’t in the default search path.
If you don’t do a bunch of weird stuff to your C program, it will fail
as soon as it dynamically loads your .so at runtime: your .so will try
to dynamically load the standard library .so, it won’t find it, and
then your program will exit.

I find that a bit odd. How accurate is this, factoring in possible differences between the major desktop/server distros of Linux?

This is purely out of curiosity, as I do Windows only (C++) programming at the moment.


As for Windows, I had to do a bit of lookup and I’ll put it here for reference:
A C++ executable will normally link to MSVCR*.DLL for the C std library and MSVCP*.DLL for the stuff of the STL that resides in this DLL. Both of these either reside in the system32 directory, or, for the manifested stuff they’ll reside in a subdir of Windows SideBySide cache (winsxs folder).

  • 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-26T00:22:00+00:00Added an answer on May 26, 2026 at 12:22 am

    I am doing this thing all the time, and it works fine. I am pretty sure that that guy had a totally unrelated problem and blamed the library search paths for it.

    I have never seen any linux distro where the libstdc++.so is not in the /usr/lib[64]/ path.

    Which also makes me wonder how C++ programs generally work for that guy, since to my knowledge the search path for .so files is language agnostic.

    Maybe he always uses a special version and compiles all his programs with -rpath linker options? But even then, just adding that option to his C programs would work too.

    it will fail as soon as it dynamically loads your .so at runtime: your
    .so will try to dynamically load the standard library .so, it won’t
    find it, and then your program will exit.

    This makes me wonder if he solely refers to using dlopen() on your own .so. But also then it works just fine, unless you did not link the .so to your libstdc++.so (which would then be your own fault; it would be the same problem had you dependencies on any other library, regardless what language it was written in).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this statement is some old code and it took me a second
I was reading about parsers and parser generators and found this statement in wikipedia's
I was reading this page and I found the following statement: MVC in Java
In the java docs of the map interface's entrySet() method I found this statement
I don't see why this doesn't work. I assume that for some really lame
In a coding standards document, I found this statement: Avoid using foreach to iterate
I found this statement if a thread modifies a collection directly while it is
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can
Found this rather strange bug in IE8; element.style.top is limited to 1342177 pixels. Even

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.