PDA

View Full Version : Mac deployment problem



MarkSutton71
13th May 2011, 12:58
I have a QT application written primarily in Windows that I'm trying to make a Mac conversion of (compiling with QtCreator on as OSX 10.6 machine). It uses QT 4.7.3, and VTK (Visualisation Toolkit) 5.6 (NOT using the QVTK widget). VTK compiled statically.

Program runs fine through creator, and also runs fine if I run the executable from the command line with 'open'. If I try to run the .app bundle though it crashes with an unhelpful segmentation fault message.

I suspect this must be something to do with libraries/frameworks, BUT I get the same crash whether or not I have run macdeployqt on the package. otool -L reports (before macdeployqt)

/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.3)
QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.7.0, current version 4.7.3)
QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.7.0, current version 4.7.3)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 830.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)

and after macdeployqt

/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
@executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.3)
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
@executable_path/../Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.7.0, current version 4.7.3)
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.7.0, current version 4.7.3)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 830.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)


Two other programs using the same version of QT (but not VTK, zlib, or quite as many QT libraries) work fine... app bundle runs without a hitch. I have tried removing all zlib references from program in case it was that, but same problem. Have previously compiled an older version of the same problematic program a few years back with QT 4.5 and VTK 5.4, without running into this issue.

Does anyone have any idea at all what I can try next... have wasted hours on this and am no closer to a solution! Even suggestions as to how to continue investigating would be appreciated.

Thanks in advance!

Mark

nish
15th May 2011, 04:12
its a segment fault, that means you can put some qDebugs() and see where it segfaults. Put a qDebug() right after creating a QApplication instance. If the message is printed before segfault, continue putting the qDebugs() after each line in main(). Ultimately you will find the exact location of crash.

Edit:-
If you are not able to see the terminal, then put the messages in a log file and flush/close the file after each message, so that the message does not get lost in the buffer. Implement a macro for that.