在Mac OS X上编译libqxt

5

我有最新的(libqxt)版本,使用git获取。我运行./configure命令时一切正常,但是在执行make命令时出现了以下错误:

linking ../../lib/QxtWidgets.framework/QxtWidgets
ld: warning: directory not found for option '-L/usr/local/pgsql/lib'
ld: warning: directory not found for option '-L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
ld: warning: directory not found for option '-F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
Undefined symbols for architecture x86_64:
  "_CGSGetWindowProperty", referenced from:
      QxtWindowSystem::windowTitle(long)   in qxtwindowsystem_mac.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../../lib/QxtWidgets.framework/QxtWidgets] Error 1
make: *** [sub-src-widgets-install_subtargets] Error 2

如果有影响的话,我正在使用OSX Mountain Lion操作系统。
谢谢!
2个回答

4
作为一种hacky的修复方法,您可以直接删除CGSGetWindowProperty属性调用 - Qxt将编译,但是QxtWindowSystem::windowTitle当然无法正常工作。
diff --git a/src/widgets/mac/qxtwindowsystem_mac.cpp b/src/widgets/mac/qxtwindowsystem_mac.cpp
index 63cab38..de4a89c 100644
--- a/src/widgets/mac/qxtwindowsystem_mac.cpp
+++ b/src/widgets/mac/qxtwindowsystem_mac.cpp
@@ -89,11 +89,7 @@ QString QxtWindowSystem::windowTitle(WId window)
     // most of CoreGraphics private definitions ask for CGSValue as key but since
     // converting strings to/from CGSValue was dropped in 10.5, I use CFString, which
     // apparently also works.
-    err = CGSGetWindowProperty(connection, window, (CGSValue)CFSTR("kCGSWindowTitle"), &windowTitle);
-    if (err != noErr) return QString();
-
-    // this is UTF8 encoded
-    return QCFString::toQString((CFStringRef)windowTitle);
+    return QString();
 }

 QRect QxtWindowSystem::windowGeometry(WId window)

为了以后的参考,您可以监控libqxt存储库中此问题


嗨,如果可能的话,你可以回答这个问题吗:https://dev59.com/SIjca4cB1Zd3GeqPtDAN?我尝试了你说的修复方法,但在“make install”步骤中出现了错误。 - SexyBeast

4

看起来Qxt正在使用一些在Mountain Lion中删除的私有Mac OS X API。CGSGetWindowProperty在之前的Mac OS X版本中没有记录,所以我猜它也不可靠。


1
是的,我也是这么想的...你认为有什么方法可以避开这个问题,或者在其他地方找到头文件/库?如果有的话,那在哪里? - sfw

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接