Well.. It took me a while and cost some neural cells to get qtruby installed on my new MacBook.
After doing the tutorial for Basic principles of high frequency technics during the last semester I now have time to resume work at my software that will be published along with PHOTOSS as soon as it’s done. PQueue is the name and after I had began this project in C++ I started over in Ruby just before the semester. Back then I used my Windows machine the chair gave me. But now I use my very cool MacBook Pro for everything. I really did look forward to writing Ruby code with Textmate on MacOSX…!
But! ..there are a lot of pitfalls one can fall into when trying to compile qtruby on MacOSX. To save you the hassle I had to go through I’m writing this post.
I’m using the latest - at the time of writing – MacOSX 10.5.8. I already had Qt-4.5.2 installed. I’ve downloaded qt4-qtruby-2.0.3, decompressed it and tried
cmake . makebut got
… Can’t open perl script “2/kalyptus”: No such file or directory make[2]: *** [smoke/qt/smokedata.cpp] Error 2 make[1]: *** [smoke/qt/CMakeFiles/smokeqt.dir/all] Error 2 make: *** [all] Error 2 lucksus:qt4-qtruby-2.0.3 2 nico$I remembered there was a problem with this. My friend Wojtek already wrote a post concerning compiling qtruby under MacOSX. After reading this again I downloaded Qt-4.4.3 and qt4-qtruby-1.4.10. I don’t like packages that use a installer to spread their parts across my hard disk leaving me confused where everything went. So after seeing my first attempts failing I wanted a Qt source package. But for MacOSX you have to be sure to take the “mac” version. So download qt-mac-opensource-src-4.4.3.tar.bz2 from Trolltech’s (err.. Nokia’s) FTP server (not qt-all-opensource-src-4.4.3! Otherwise you will get something like “XEvent not declared…“). Then add QtWebKit to link.txt as Wojtek mentioned. Also notice my comment there stating to do the same with a second link.txt in another directory.
Now everything could be ok for you if you don’t have different Qt versions installed. What I got was
So some symbols referenced from libQtUiTools.a could not be found when linking. To see the compiler command line I entered
make VERBOSE=1
and got
… Linking CXX shared library libsmokeqt.dylib cd /Users/nico/Desktop/qt4-qtruby-1.4.10/smoke/qt && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/smokeqt.dir/link.txt –verbose=1 /usr/bin/c++ -dynamiclib -headerpad_max_install_names -compatibility_version 2.0.0 -current_version 2.0.0 -o libsmokeqt.2.0.0.dylib -install_name /Users/nico/Desktop/qt4-qtruby-1.4.10/smoke/qt/libsmokeqt.2.dylib CMakeFiles/smokeqt.dir/smokedata.o CMakeFiles/smokeqt.dir/x_1.o CMakeFiles/smokeqt.dir/x_2.o CMakeFiles/smokeqt.dir/x_3.o CMakeFiles/smokeqt.dir/x_4.o CMakeFiles/smokeqt.dir/x_5.o CMakeFiles/smokeqt.dir/x_6.o CMakeFiles/smokeqt.dir/x_7.o CMakeFiles/smokeqt.dir/x_8.o CMakeFiles/smokeqt.dir/x_9.o CMakeFiles/smokeqt.dir/x_10.o CMakeFiles/smokeqt.dir/x_11.o CMakeFiles/smokeqt.dir/x_12.o CMakeFiles/smokeqt.dir/x_13.o CMakeFiles/smokeqt.dir/x_14.o CMakeFiles/smokeqt.dir/x_15.o CMakeFiles/smokeqt.dir/x_16.o CMakeFiles/smokeqt.dir/x_17.o CMakeFiles/smokeqt.dir/x_18.o CMakeFiles/smokeqt.dir/x_19.o CMakeFiles/smokeqt.dir/x_20.o -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtNetwork -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtOpenGL -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtDBus -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtSql -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtSvg /usr/lib/libQtUiTools.a -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtXml -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtWebKit -F/usr/local/Trolltech/Qt-4.4.3/lib -framework Qt3Support -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtCore -lpthread -F/usr/local/Trolltech/Qt-4.4.3/lib -framework QtGui Undefined symbols: “QString::compare_helper(QChar const*, int, QChar const*, int, Qt::CaseSensitivity)”, referenced from: QStringRef::compare(QString const&, Qt::CaseSensitivity) constin libQtUiTools.a(abstractformbuilder.o) “QBoxLayout::stretch(int) const”, referenced from: __ZNK10QBoxLayout7stretchEi$non_lazy_ptr in libQtUiTools.a(formbuilderextra.o) …Whoops! libQtUiTools.a is taken from /usr/lib while my self-compiled Qt install resides in /usr/local/Trolltech/Qt-4.4.3. So libQtUiTools.a must be from another Qt install. To fix this you have to alter link.txt again and replace /usr/lib/libQtUiTools.a with /usr/local/Trolltech/Qt-4.4.3/lib/libQtUiTools.a or whatever is right for you.
Boy, anybody has to improve qtruby’s installation process for macs, perhaps by creating a binary gem as it already exists for Windows…?