Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing a library written in C++ from a pure C project on Linux?
    text
    copied!<p>Found this statement <a href="https://softwareengineering.stackexchange.com/questions/79258/c-programming-in-linux-in-2011/79273#79273">over at PSE</a>: (quoting <a href="https://softwareengineering.stackexchange.com/users/1696/bob-murphy">Bob</a>)</p> <blockquote> <p>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.</p> </blockquote> <p>I find that a bit odd. How accurate is this, factoring in possible differences between the major desktop/server distros of Linux?</p> <p><sub>This is purely out of curiosity, as I do Windows only (C++) programming at the moment.</sub></p> <hr> <p>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 <a href="http://msdn.microsoft.com/en-us/library/abx4dbyh%28v=VS.80%29.aspx" rel="nofollow noreferrer">MSVCR*.DLL</a> for the C std library and <a href="http://msdn.microsoft.com/en-us/library/abx4dbyh%28v=VS.80%29.aspx" rel="nofollow noreferrer">MSVCP*.DLL</a> 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 (<em>winsxs folder</em>).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload