Hodapp87
18th March 2010, 16:11
I was tasked with maintaining a Mac OS X port of a Qt application in Qt Creator (most of the development is done for Windows in Visual Studio). Everything builds fine, and then I am using a script which utilizes macdeployqt to add in Qt dependencies to the application bundle.
If I try to run this bundle, I get the error: "QWidget: Must construct a QApplication before a QPaintDevice". Running from commandline shows that a series of messages like this precede it:
objc[12020]: Class QMacSoundDelegate is implemented in both
/Library/Frameworks/QtGui.framework/Versions/4/QtGui and
/Users/uliggett/Q/NAVY_SBIR_NDE_PII/NLign3D/NLign3D.app/
Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui.
Using implementation from /Users/uliggett/Q/NAVY_SBIR_NDE_PII/NLign3D/NLign3D.app/
Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui.
This happens in both debug mode and release mode.
If I remove all the Qt libraries from the Contents/Frameworks/ folder of the bundle (I tried this after reading this thread (http://www.qtcentre.org/threads/23559-Application-deployment-on-Mac-OS-X-(10-5)?p=136044&highlight=)), then the application starts and runs flawlessly, apparently using the Qt libraries from the system path rather than the bundle. However, this is not a viable solution because the bundle is something that we will distribute, likely to users who do not have Qt installed elsewhere.
I tried directly copying the relevant libraries from the system path into the bundle. This resulted in the new error "QWidget: Cannot create a QWidget when no GUI is being used."
As far as I can tell, the libraries inside the bundle and the libraries inside /Libraries/Framework etc. are completely identical except that 'otool -L' reports that they are linked against different locations of Qt libraries (i.e. those inside the bundle point to more libraries inside the bundle, while those in the system path point to more in the system path, which makes sense).
Can anyone shed some light on this issue?
If I try to run this bundle, I get the error: "QWidget: Must construct a QApplication before a QPaintDevice". Running from commandline shows that a series of messages like this precede it:
objc[12020]: Class QMacSoundDelegate is implemented in both
/Library/Frameworks/QtGui.framework/Versions/4/QtGui and
/Users/uliggett/Q/NAVY_SBIR_NDE_PII/NLign3D/NLign3D.app/
Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui.
Using implementation from /Users/uliggett/Q/NAVY_SBIR_NDE_PII/NLign3D/NLign3D.app/
Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui.
This happens in both debug mode and release mode.
If I remove all the Qt libraries from the Contents/Frameworks/ folder of the bundle (I tried this after reading this thread (http://www.qtcentre.org/threads/23559-Application-deployment-on-Mac-OS-X-(10-5)?p=136044&highlight=)), then the application starts and runs flawlessly, apparently using the Qt libraries from the system path rather than the bundle. However, this is not a viable solution because the bundle is something that we will distribute, likely to users who do not have Qt installed elsewhere.
I tried directly copying the relevant libraries from the system path into the bundle. This resulted in the new error "QWidget: Cannot create a QWidget when no GUI is being used."
As far as I can tell, the libraries inside the bundle and the libraries inside /Libraries/Framework etc. are completely identical except that 'otool -L' reports that they are linked against different locations of Qt libraries (i.e. those inside the bundle point to more libraries inside the bundle, while those in the system path point to more in the system path, which makes sense).
Can anyone shed some light on this issue?