Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Qt example not working on Linux #1
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:
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=0.0.0.0, 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
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?