[Qt-interest] [Build] Using -qtnamespace
Rush Manbert
rush at manbert.com
Wed Mar 24 00:35:29 CET 2010
I have successfully built Qt from the 4.6.0 source. We need to distribute the Qt frameworks that we require, and they need to be in a shared location on the Mac. We have put them inside a framework that we created, and linked against the "frameworks-within-a-framework". Our framework is located in /Library/Frameworks. However, if we also have a "normal" Qt installation, where the Qt frameworks are sitting in /Library/Framework, then the loader spits out messages at runtime that say it can find the same symbol in both the framework we linked against and the Qt installation framework, and which one will be used is undefined. We need to have our Qt installation be used, even if the end user is a developer who has the full library installation. Putting the Qt frameworks inside our app bundles is NOT an option.
We decided to build Qt using the -qtnamespace configuration option, so the symbols would be in a different namespace.
I tried adding -qtnamespace rushQt to the configuration options.
The build fails with the error message "Integer constant is too large for 'long' type". I tracked it down to the header file
src/gui/kernel/qt_mac_p.h
which contains this code:
#if defined(QT_NAMESPACE) && defined(QT_NAMESPACE_MAC_CRC)
// Take the CRC we generated at configure time. This *may* result in a
// collision with another value If that is the case, please change the value
// here to something other than 'Cute'.
const UInt32 kEventClassQt = QT_NAMESPACE_MAC_CRC;
#else
const UInt32 kEventClassQt = 'Cute';
#endif
My build uses the "if" path, so uses the value of QT_NAMESPACE_MAC_CRC. I find that on the compile command line defined as: -DQT_NAMESPACE_MAC_CRC=18374966856734927113 so it's pretty clear that number won't fit in 32 bits.
I found two bug reports about this. One said that Qt 4.6.0 won't build with -qtnamespace (bug #6423), and IIRC (because I can't seem to view the page right now) it says it is fixed in 4.6.1. There is an older report (#5505) that says -qtnamespace is broken when building for ppc and again, IIRC< that one is still open.
I looked at the 4.6.1 release notes and they don't say anything about fixing -qtnamespace.
Does anyone know if this problem is resolved in 4.6.2? 4.7.0? I need to be able to build for x86, ppc, and x86_64.
Thanks,
Rush
More information about the Qt-interest-old
mailing list