【问题标题】:compiling libqxt in mac osx在 mac osx 中编译 libqxt
【发布时间】:2012-08-07 04:41:20
【问题描述】:

我有最新的 (git) 版本的 libqxt。我运行 ./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。

谢谢!

【问题讨论】:

    标签: macos qt makefile libqxt


    【解决方案1】:

    似乎 Qxt 正在使用一些已在 Mountain Lion 中删除的私有 Mac OS X API。 CGSGetWindowProperty 没有记录在以前版本的 Mac OS X 中,所以我认为无论如何使用它都不可靠。

    【讨论】:

    • 是的,我也是这么想的......你认为有办法解决这个问题,或者甚至在其他地方找到头文件/库吗?如果有,在哪里?
    【解决方案2】:

    作为一个 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)
    

    您可以监控this issue in libqxt repository以供将来参考。

    【讨论】:

    猜你喜欢
    • 2012-01-17
    • 1970-01-01
    • 2012-08-18
    • 1970-01-01
    • 1970-01-01
    • 2013-09-27
    • 2010-10-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多