I was wondering if CommonQt would be expected to work for newer versions of smoke. I'm wondering because support for Mac OS X has been improving dramatically in the newest version, and I have never been able to make older (even supposedly stable) versions of smoke work on Mac OS X.
Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status
This is on Mac OS X 10.6, using Xcode 3.2.5, building an x86_64 binary, with CommonQt from quicklisp, and the newest smoke as of the time of writing.
Also note that KDE is moving to git, so the svn repository referenced on the main page is now obsolete. The new git repository is located at:
https://projects.kde.org/projects/kde/kdebindings/smoke
Elliott Slaughter elliottslaughter@gmail.com writes:
I was wondering if CommonQt would be expected to work for newer versions of smoke. I'm wondering because support for Mac OS X has been improving dramatically in the newest version, and I have never been able to make older (even supposedly stable) versions of smoke work on Mac OS X.
Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status
This is on Mac OS X 10.6, using Xcode 3.2.5, building an x86_64 binary, with CommonQt from quicklisp, and the newest smoke as of the time of writing.
Also note that KDE is moving to git, so the svn repository referenced on the main page is now obsolete. The new git repository is located at:
I've just build the latest smokeqt and smokegen from git, and commonqt compiles and works as expected. On Linux.
Quoting Elliott Slaughter (elliottslaughter@gmail.com):
Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status
Can you "make clean" again and then paste a complete build log including all gcc output?
d.
On Sun, Mar 6, 2011 at 2:19 AM, David Lichteblau david@lichteblau.comwrote:
Can you "make clean" again and then paste a complete build log including all gcc output?
Here you go (I had to rerun qmake because it initially gave me Xcode project files):
$ qmake -spec macx-g++ $ make g++ -c -pipe -g -gdwarf-2 -Wall -W -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -F/Library/Frameworks -o commonqt.o commonqt.cpp rm -f libcommonqt.1.0.0.dylib libcommonqt.dylib libcommonqt.1.dylib libcommonqt.1.0.dylib g++ -headerpad_max_install_names -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -install_name libcommonqt.1.dylib -o libcommonqt.1.0.0.dylib commonqt.o -F/Library/Frameworks -L/Library/Frameworks -lsmokeqtcore -framework QtGui -L/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -F/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -framework QtCore ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [libcommonqt.1.0.0.dylib] Error 1
Let me know if you need anything else.
Quoting Elliott Slaughter (elliottslaughter@gmail.com):
g++ -headerpad_max_install_names -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -install_name libcommonqt.1.dylib -o libcommonqt.1.0.0.dylib commonqt.o -F/Library/Frameworks -L/Library/Frameworks -lsmokeqtcore -framework QtGui -L/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -F/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -framework QtCore
Hmm, I don't see any -I or -L flags pointing to smoke there.
Perhaps that's normal (if smoke is installed in a default location that works without special flags, like /usr/local), and it must have found the header, but given that it fails to link afterwards, that's what I'd try to investigate first.
For example, if you built smokeqt with cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX=/opt/smoke make install
then CommonQt needs to be configured using: qmake LIBS=-L/opt/smoke/lib/ INCLUDEPATH=/opt/smoke/include/
(Yes, I should update the commonqt homepage/build instructions to make this clear.)
d.
On Mon, Mar 7, 2011 at 3:31 AM, David Lichteblau david@lichteblau.comwrote:
Quoting Elliott Slaughter (elliottslaughter@gmail.com):
g++ -headerpad_max_install_names -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -install_name libcommonqt.1.dylib -o libcommonqt.1.0.0.dylib commonqt.o -F/Library/Frameworks -L/Library/Frameworks -lsmokeqtcore -framework QtGui -L/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -F/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -framework QtCore
Hmm, I don't see any -I or -L flags pointing to smoke there.
Perhaps that's normal (if smoke is installed in a default location that works without special flags, like /usr/local), and it must have found the header, but given that it fails to link afterwards, that's what I'd try to investigate first.
For example, if you built smokeqt with cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX=/opt/smoke make install
then CommonQt needs to be configured using: qmake LIBS=-L/opt/smoke/lib/ INCLUDEPATH=/opt/smoke/include/
Ok, my smoke was installed to ${HOME}/Programming/Lisp/new_kde_build/install, so I would have expected the following to work. I'm still getting the same error, although the -I and -L arguments do appear in the commands. See anything wrong with the following?
Thanks.
$ qmake LIBS=-L${HOME}/Programming/Lisp/new_kde_build/install/lib INCLUDEPATH=${HOME}/Programming/Lisp/new_kde_build/install/include -spec macx-g++ $ make clean rm -f commonqt.o rm -f *~ core *.core $ make g++ -c -pipe -g -gdwarf-2 -Wall -W -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I/Users/elliott/Programming/Lisp/new_kde_build/install/include -I. -F/Library/Frameworks -o commonqt.o commonqt.cpp rm -f libcommonqt.1.0.0.dylib libcommonqt.dylib libcommonqt.1.dylib libcommonqt.1.0.dylib g++ -headerpad_max_install_names -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -install_name libcommonqt.1.dylib -o libcommonqt.1.0.0.dylib commonqt.o -F/Library/Frameworks -L/Library/Frameworks -L/Users/elliott/Programming/Lisp/new_kde_build/install/lib -lsmokeqtcore -framework QtGui -L/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -F/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -framework QtCore ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [libcommonqt.1.0.0.dylib] Error 1
Just to show that the libs are really there:
$ ls ${HOME}/Programming/Lisp/new_kde_build/install/lib libclsmokeqtcore.0.0.1.dylib libsmokeqtnetwork.dylib libclsmokeqtcore.0.0.dylib libsmokeqtopengl.3.0.0.dylib libclsmokeqtcore.dylib libsmokeqtopengl.3.dylib libcppparser.dylib libsmokeqtopengl.dylib ....
P.S. Do you know what /tmp/qt-stuff-6474 is? I have no idea what that would be, I definitely didn't install Qt to that location.
Quoting Elliott Slaughter (elliottslaughter@gmail.com):
Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [libcommonqt.1.0.0.dylib] Error 1
Just a shot in the dark, but I had a linking error on Windows, because CommonQt still links to smokeqtcore, and actually needs smokebase.
Does it help if you change s/smokeqtcore/smokebase/ in commonqt.pro before re-running qmake?
Thanks, d.
On Tue, Mar 8, 2011 at 10:30 AM, David Lichteblau david@lichteblau.comwrote:
Quoting Elliott Slaughter (elliottslaughter@gmail.com):
Undefined symbols: "Smoke::classMap", referenced from: Smoke::findClass(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o "Smoke::NullModuleIndex", referenced from: Smoke::idMethod(short, short)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idClass(char const*, bool)in commonqt.o Smoke::idMethodName(char const*)in commonqt.o Smoke::findClass(char const*)in commonqt.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [libcommonqt.1.0.0.dylib] Error 1
Just a shot in the dark, but I had a linking error on Windows, because CommonQt still links to smokeqtcore, and actually needs smokebase.
Does it help if you change s/smokeqtcore/smokebase/ in commonqt.pro before re-running qmake?
Yup, that fixed the link error.
I have a couple of quibbles about the way you load foreign libraries. The first is that you hard code the .so extension for non-unix platforms. Mac OS X uses a .darwin extension. Here's a minimal fix for that:
diff --git a/ffi.lisp b/ffi.lisp index 36a4a99..0dd1fc0 100755 --- a/ffi.lisp +++ b/ffi.lisp @@ -34,10 +34,14 @@
(defun load-libcommonqt () (cffi:load-foreign-library - #-(or windows mswindows win32) + #-(or windows mswindows win32 darwin) (namestring (merge-pathnames "libcommonqt.so" (asdf::component-relative-pathname (asdf:find-system :qt)))) + #+(or darwin) + (namestring (merge-pathnames "libcommonqt.dylib" + (asdf::component-relative-pathname + (asdf:find-system :qt)))) #+(or windows mswindows win32) (namestring (merge-pathnames "debug/commonqt.dll" (asdf::component-relative-pathname diff --git a/info.lisp b/info.lisp index 6615e82..dcb9b52 100755 --- a/info.lisp +++ b/info.lisp @@ -696,7 +696,8 @@ #+debug (assert (< idx (length *module-table*))) (cffi:load-foreign-library (format nil - #-(or mswindows windows win32) "libsmoke~A.so" + #-(or mswindows windows win32 darwin) "libsmoke~A.so" + #+(or darwin) "libsmoke~A.dylib" #+(or mswindows windows win32) "smoke~A.dll" name)) (let ((init (cffi:foreign-symbol-pointer
But beyond that basic issue, you don't take advantage of CFFI's *foreign-library-directories* feature, which is going to make it difficult for me to relocate the shared libraries. For example, if I wanted to save a core and distribute it as a binary, I don't think I'll be able to do that easily with this setup.
For an example of how to do this look at lispbuilder-sdl's ffi code, especially around lines 9 and 27.
http://code.google.com/p/lispbuilder/source/browse/trunk/lispbuilder-sdl/cff...
At any rate, I can run the tutorial code, so thanks for the help :-).
commonqt-devel@common-lisp.net