lqt
lqt copied to clipboard
building on 10.6 osx
hi - I'm getting the following error after 'make'
....... Linking CXX shared module lib/qtsvg.so [ 69%] Built target qtsvg Scanning dependencies of target generate_qtuitools_xml [ 69%] Generating XML: running cpptoxml on qtuitools Error: wether 'QtUiTools' nor '/Library/Frameworks/QtCore.framework/QtUiTools/QtUiTools' or '/Library/Frameworks/QtUiTools.framework/Headers/QtUiTools' found make[2]: *** [CMakeFiles/generate_qtuitools_xml] Error 1 make[1]: *** [CMakeFiles/generate_qtuitools_xml.dir/all] Error 2 make: *** [all] Error 2
any idea ?!
lua is 5.1.4 and Qt is 4.7.3 Cocoa
So it seems that somehow QtUITools is missing from the Qt install ?!?! I installed Qt from this file => http://get.qt.nokia.com/qt/source/qt-mac-opensource-4.7.3.dmg from http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x any thoughts ?!
ok - so i fixed this by symlinking my /usr/include/QtUITools to the frameworks folder (not entirely sure how that /usr/include was installed). Now I get this :
Scanning dependencies of target qtgui [ 69%] Building CXX object CMakeFiles/qtgui.dir/qtgui_src/qtgui_merged_build.cpp.o [ 69%] Building CXX object CMakeFiles/qtnetwork.dir/qtnetwork_src/qtnetwork_slot.cpp.o [ 69%] Building CXX object CMakeFiles/qtsql.dir/qtsql_src/qtsql_enum.cpp.o [ 69%] Building CXX object CMakeFiles/qtnetwork.dir/qtnetwork_src/moc_qtnetwork_slot.cxx.o [ 69%] Building CXX object CMakeFiles/qtsql.dir/qtsql_src/qtsql_meta.cpp.o Linking CXX shared module lib/qtnetwork.so ld: can't write output file: lib/qtnetwork.so collect2: ld returned 1 exit status make[2]: *** [lib/qtnetwork.so] Error 1 make[1]: *** [CMakeFiles/qtnetwork.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
why wouldn't it be able to write to lib -- it certainly exists .. !
... ok bizarely it built with : sudo make -j4
perhaps the /usr/include needed sudo to read it when linking
Sorry for that, I forgot that in order to build correctly, I had to disable the UiTools module on Mac OS X. Just comment the following line in CMakeLists.txt:
#build_qt_lib_binding(QtUiTools QtCore QtGui QtXml)
I will modify the CMakeLists.txt to disable it automatically on Mac.
great stuff - any idea on the malloc error ?
If like me you want to use lqt on Snow Leopard but still need Lua in 64-bit mode (e.g. some 64-bit Luarocks extensions, etc...), you may want to install Lua as a x86_64/i386 fat file binary.
This is what you get with a standard build on Snow Leopard:
$ lipo -info /usr/local/lib/liblua.a Non-fat file: /opt/local/lib/liblua.a is architecture: x86_64
Now either install Lua with Macports:
sudo port install lua +universal
$ lipo -info /opt/local/lib/liblua.a Architectures in the fat file: liblua.a are: i386 x86_64
Or change the following lines in your Makefile in the lua-5.1.4 distribution src/ folder:
MYCFLAGS= -arch i386 -arch x86_64 MYLDFLAGS= -arch i386 -arch x86_64
macosx: $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX -arch i386 -arch x86_64" MYLIBS="-arch i386 -arch x86_64 -lreadline"
liblua.dylib: $(CORE_O) $(LIB_O) $(CC) -arch i386 -arch x86_64 -dynamiclib -o $@ $^ $(LIBS)
(end of Makefile)
Then:
make macosx
make install
$ lipo -info /usr/local/lib/liblua.a Architectures in the fat file: liblua.a are: i386 x86_64
$ file /usr/local/lib/liblua.a liblua.a: Mach-O universal binary with 2 architectures liblua.a (for architecture i386): current ar archive random library liblua.a (for architecture x86_64): current ar archive random library
Now after running export LUA_CPATH=$PWD/lqt/build/lib/?.so, use the arch command when invoking Lua: arch -i386 /usr/local/bin/lua ../lqt/test/webview.lua or the other examples. (The '-i386' switch makes a universal binary run in Intel 32-bit mode. '-x86_64' makes it run in Intel 64-bit mode. -ppc and -ppc64 is for PPC architectures.)
Thanks for your guide, I will try it out when I get access to a Mac machine. What still bothers me is that I specifically downloaded the Cocoa: Mac binary package for Mac OS X 10.5 - 10.6 (32-bit and 64-bit), which seems to be 32-bit only...