[EMAIL PROTECTED] writes:

> How can a C/C++ application which explicitly loads a C++ shared

Explicitly as in dlopen(...)?

> library at runtime determine the g++ version (and even libstdc++
> version) used for the compilation of the C++ shared library on Linux?

This is somewhat a hack:

If you know the absolute path where the library is coming from,
you could popen("objdump -p /path/to/dso | grep NEED") and find
out whether it uses libstdc++.so.5 or libstdc++.so.6.

You could also run 'strings' on that library, and get a very strong clue:

$ strings -a foo.so | grep GNU
GCC: (GNU) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
GCC: (GNU) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
...

If you don't know where the library will come from, you could
dlopen() it, then iterate over _r_debug.r_map link chain (see
/usr/include/link.h) to find its path.

But (AFAIK) there is no "proper API" you could call to find out.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to