Applications and bundled libraries in the Ideal World (LSB)
Applications and bundled libraries in the Ideal World (LSB)
Posted Mar 18, 2010 21:07 UTC (Thu) by aleXXX (subscriber, #2742)In reply to: Applications and bundled libraries in the Ideal World (LSB) by vomlehn
Parent article: Applications and bundled libraries
Maybe I did it wrong or I had wrong expectations.
So, I have a binary software built on SUSE 10 (SLES). Somewhere I found
that SUSE 10 is LSB 3.0 compatible.
So is RHEL 4/Centos 4, according to some webpage.
So I expected that the software built on SUSE 10 would also run on Centos
4. It didn't, it was expecting a symbol not present on Centos 4.
That symbol came from libstdc++, something in std::string, and it was
referenced by log4cplus. So I actually expected that log4cplus wouldn't
compile on Centos4, since there that symbol was missing, but it compiled
nevertheless successfully.
What was the reason ?
std::string has a lot of inline-functions, which call more or less
internal functions of libstdc++. Since they are inline, these calls to
internal functions end up in the resulting binary, instead of being
hidden in the binary libstdc++.
So what to do if you want to ship a binary application ?
Not sure. Link statically against libstdc++ ? Not too easy, as the web
told me.
Ship with a copy of libstdc++.so which works ? I tried, it seems to work.
But I'm not sure whether this doesn't have any other issues.
Use some other STL implementation, like STLport or stdcxx from Apache ?
Maybe, haven't tried yet.
Alex
