[gephex-devel] report: gephex on mac os x with qt4

Georg Seidel georg at gephex.org
Tue May 2 20:23:41 CEST 2006


Hi all,

for a long time now, I wanted to get gephex compiling on my ibook again.
Since fink does not provide qt4, it was necessary to install qt
manually.
Here is a short report of the problems I encountered, in case anybody
else wants to do this.

First, I had to downgrade QuickTime to version 7.0.1 [1], because newer
versions would cause linker errors.

I then downloaded qt 4.1.2 from trolltech [2]. My first try was to 
install it *not* as a framework, but as dylibs
("configure -no-framework"),
which I thought would have been a lot easier to link against with our
current build system.
Of course this did not work. Libtool created strange errors when trying
to link our gui, which I could not solve or work around ("libtool:
Cannot find library `'").
So I installed qt as a set of frameworks (the default behavior of the
qt build system).

This made it necessary, to change all qt includes (I used a simple sed
script to automate most of it).
Reason: mac os x frameworks are actually directories that contain the
libraries *and* the headers.
The QtCore framework for example, which is installed into
<qt_prefix>/lib, has roughly the following directory structure:

   QtCore.framework
     Contents
       ...
     Headers
       qobject.h
       ...
     QtCore           <- the lib
     ...

Apple changed gcc [3] to look into the right directory automatically
when given an "-F<dir>" switch: if it sees "#include <QtCore/qobject.h>"
it will look into "<dir>/QtCore.framework/Headers".
Because we had -I switches for all the Qt include dirs (also QtCore),
we would only have "#include <qobject.h>" in our code, which gcc would
not find.

After changing our include statements and fiddling around with qt.m4
for some time, I finally got gephex to compile and link with qt 4.1.2.
The nice thing is that it now links against a native qt version!

Running it revealed that we still have serious problems in our qt gui:

   * there is no menu
   * the gui does not react on clicks or keyboard input reliably (less
      than 10% of the input events seem to be received)
   * the gui is always automatically in the background, that is, as soon
     as there is any other window, the gui is behind it

I hope this information will be of help to somebody...


Regards,

Georg


[1]http://www.apple.com/support/downloads/quicktime701reinstallerforquicktime704.html
[2]http://www.trolltech.com/download/qt/mac.html
[3]http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/Directory-Options.html


More information about the gephex-devel mailing list