trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2012

Re: [trinity-devel] QT API renaming! Why?!

From: Mike Bird <mgb-trinity@...>
Date: Wed, 7 Mar 2012 13:14:37 -0800
On Wed March 7 2012 09:41:23 Timothy Pearson wrote:
> Let's take a simple example, qWarning.  This becomes _Z8qWarningPKcz in
> libqt-mt.so.3.3.8 (nm -D /usr/lib/libqt-mt.so | grep qWarning), and
> _Z8qWarningPKcz in /usr/lib/libQtCore.so (nm -D /usr/lib/libQtCore.so |
> grep qWarning).  If my program references Z8qWarningPKcz, which library
> will the symbol resolver choose at runtime?  They are not binary
> compatible with each other, and when the symbol resolver chooses the wrong
> one at runtime (which it will do quite often) the entire program will
> crash.

Could the problem you describe be addressed more easily with C++ namespaces?

--Mike Bird