trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2012

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

From: "Timothy Pearson" <kb9vqf@...>
Date: Wed, 7 Mar 2012 16:39:03 -0600
> 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

No, unfortunately.  The methods and variables that are in conflict are
either static global or due to identical class and method naming.  Also,
using namespaces that heavily will introduce other problems.

Tim