Qt example not working on Linux #1

robpvn opened this Issue Dec 24, 2011 · 1 comment


None yet
2 participants

robpvn commented Dec 24, 2011

Currently I'm on OpenSUSE 11.4 x64 with GCC 4.5.1, Mono 2.10.2 and GCC-XML compiled from CVS source. The hello world example works as expected.

After running make in the qt directory, compilation proceeds without any errors but with three warnings that seem rather harmless, included here for completeness:

generated/QApplication.cs(228,35): warning CS0108: Qt.Gui.QApplication.Exec()' hides inherited memberQt.Gui.QCoreApplication.Exec()'. Use the new keyword if hiding was intended
generated/QCoreApplication.cs(120,35): (Location of the symbol related to previous warning)
src/QPoint.cs(10,29): warning CS0414: The private field Qt.Gui.QPoint.xy' is assigned but its value is never used src/QPoint.cs(10,33): warning CS0414: The private fieldQt.Gui.QPoint.yx' is assigned but its value is never used

When trying to run the resulting hello.exe, it crashes with this exception:

Unhandled Exception: System.TypeLoadException: Could not load type 'Qt.Gui.QApplication' from assembly 'Qt.Gui-binding, Version=, Culture=neutral, PublicKeyToken=null'.

I figure this has something to do with the library not being loaded properly, and right enough there is no .so file in the directory. So looking at Makefile.am I see that libQtGui-inline.so has been commented out from the make all routine. Removing the comment (or just running make libQtGui-inline.so) gets me this:

g++: QtGui: No such file or directory
g++: QtCore: No such file or directory
cc1plus: error: unrecognized command line option "-framework"
cc1plus: error: unrecognized command line option "-framework"
make: *** [libQtGui-inline.so] Error 1

Now, from googling about I gather that the -framework option seems to be only for Mac OS X/Darwin (http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html), so I try changing the framework options to "-I/usr/include/QtCore -I/usr/include/QtGui". Now it compiles without error and I get my .so, but running hello.exe still gives the same exception.

Is there something else that is missing, like should the actual Qt .so files from usr/lib be copied into the folder as well? I noticed that libQtGui-inline.so is compiled with the -m32 option, is this something that should be left alone or should it be changed when running on a 64-bit machine?

This comment has been minimized.

Show comment Hide comment

ludmiloff Jan 3, 2012

I can confirm that too, Ubuntu 11.10 32 bit, also not working

I can confirm that too, Ubuntu 11.10 32 bit, also not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment