Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'm trying to build kxstitch, which is designed for Linux, on OS X. I've gotten most of the way there by installing MacPorts, XCode, KDE, etc. and making minor changes to the build file, but am getting this error at the final stage of building the project:

Linking CXX executable
Undefined symbols for architecture x86_64:
  "QX11Info::display()", referenced from:
      Editor::keyPressAlphabet(QKeyEvent*) in Editor.o

The key line in the build script is:

cmake -DCMAKE_INSTALL_PREFIX=kde4-config --prefix .. && make -j${THREADS}

Here is CMakeLists.txt.

The missing symbol seems to be part of Qt. As part of installing KDE through MacPorts, many Qt-related packages were installed, including qt4-mac, qt4-mac-devel, and qt4-x11. The output of cmake includes:

-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt-Version 4.8.2
--  -> QT_QMAKE_EXECUTABLE is /opt/local/bin/qmake
--  -> QT_INCLUDE_DIR is /opt/local/include
--  -> QT_QTCORE_INCLUDE_DIR is /opt/local/include/QtCore
--  -> QT_BINARY_DIR is /opt/local/bin
--  -> QT_LIBRARY_DIR is /opt/local/lib
--  -> QT_PLUGINS_DIR is /opt/local/share/qt4/plugins
--  -> QT_MKSPECS_DIR is /opt/local/share/qt4/mkspecs

I'd be grateful for any advice on how to proceed.

UPDATE: I've since read about a problem with the QtGui library on OS X, although I don't know how to translate the solution to CMAKE.

share|improve this question
I tried tagging this "cmake" but the tag didn't exist, and I don't have enough reputation here to create it. – espertus Jul 5 '12 at 3:15
a linking problem can be often restricted to 3 scenarios: you are using the wrong library or you are using the wrong compiler or you are using the wrong linking options, have a look at… and see if this helps – user827992 Jul 6 '12 at 23:51
I found out there's a known issue with QtGui on OS X [] and was able to remove the references to the library. I'm inclined to delete this question because I no longer care about the answer but wanted to at least reply to your comment, which I appreciate. – espertus Jul 6 '12 at 23:57
don't do that, answer the question yourself and leave this question open for future references. – user827992 Jul 6 '12 at 23:59
I can't answer the question myself, since I still don't know how to use QtGui on OS X with CMake, although I do understand the problem better than I did before. – espertus Jul 7 '12 at 0:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.