Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compiling libqxt in mac osx

I have the latest (git) version of libqxt. I run ./configure and that works just fine, then make fails with this error:

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

If it matters, I'm using OSX Mountain Lion.

Thanks!

like image 619
sfw Avatar asked Aug 09 '12 21:08

sfw


2 Answers

Seems like Qxt is using some private Mac OS X API that was removed in Mountain Lion. CGSGetWindowProperty was not documented in previous versions of Mac OS X, so I gues it wasn't reliable to use it anyway.

like image 169
Kamil Klimek Avatar answered Oct 25 '22 15:10

Kamil Klimek


As a hacky fix you can just remove CGSGetWindowProperty property call - Qxt will compile , but of course QxtWindowSystem::windowTitle will not work correctly.

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)

For the future reference you can monitor this issue in libqxt repository.

like image 30
Andrew Avatar answered Oct 25 '22 17:10

Andrew