Opened 12 years ago
Closed 12 years ago
#34947 closed defect (fixed)
qt4-mac: pkg-config in +framework
Reported by: | mojca (Mojca Miklavec) | Owned by: | michaelld (Michael Dickens) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.1 |
Keywords: | Cc: | ||
Port: | qt4-mac |
Description
If I install qt4-mac +framework, gnuplot compilation breaks with
c++ -DHAVE_CONFIG_H -I. -I.. -I../term -I../term -DBINDIR=\"/path/to/gnuplot/inst/bin\" -DX11_DRIVER_DIR=\"/path/to/gnuplot/inst/libexec/gnuplot/4.7\" -DQT_DRIVER_DIR=\"/path/to/gnuplot/inst/libexec/gnuplot/4.7\" -DGNUPLOT_SHARE_DIR=\"/path/to/gnuplot/inst/share/gnuplot/4.7\" -DGNUPLOT_PS_DIR=\"/path/to/gnuplot/inst/share/gnuplot/4.7/PostScript\" -DGNUPLOT_JS_DIR=\"/path/to/gnuplot/inst/share/gnuplot/4.7/js\" -DGNUPLOT_LUA_DIR=\"/path/to/gnuplot/inst/share/gnuplot/4.7/lua\" -DCONTACT=\"gnuplot-bugs@lists.sourceforge.net\" -DHELPFILE=\"/path/to/gnuplot/inst/share/gnuplot/4.7/gnuplot.gih\" -DGNUPLOT_X11=\"`echo gnuplot_x11 | sed 's,x,x,'`\" -DXAPPLRESDIR=\"/etc/X11/app-defaults/\" -DQTGNUPLOT_DATA_DIR=\"/path/to/gnuplot/inst/share/gnuplot/4.7/qt\" -I/opt/local/include -I/opt/local/include -I/opt/local/include -D_REENTRANT -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng14 -I/opt/local/include/pango-1.0 -DQT_SHARED -I/opt/local/include -I/opt/local/include/QtCore -I/opt/local/include/QtGui -I/opt/local/include/QtNetwork -I/opt/local/include/QtSvg -g -O2 -ObjC -MT qt_term.o -MD -MP -MF .deps/qt_term.Tpo -c -o qt_term.o `test -f 'qtterminal/qt_term.cpp' || echo './'`qtterminal/qt_term.cpp In file included from qtterminal/qt_term.cpp:44: In file included from /opt/local/include/QtCore/QtCore:3: /opt/local/include/QtCore/qalgorithms.h:57:1: error: expected function body after function declarator namespace QAlgorithmsPrivate { ^ /opt/local/include/QtCore/qalgorithms.h:165:1: error: unknown type name 'template' template <typename T> ^ /opt/local/include/QtCore/qalgorithms.h:165:10: error: expected identifier or '(' template <typename T> ^ /opt/local/include/QtCore/qalgorithms.h:176:1: error: unknown type name 'template' template <typename RandomAccessIterator> ^ /opt/local/include/QtCore/qalgorithms.h:176:10: error: expected identifier or '(' template <typename RandomAccessIterator> ^ In file included from qtterminal/qt_term.cpp:44: In file included from /opt/local/include/QtCore/QtCore:4: In file included from /opt/local/include/QtCore/qbitarray.h:45: In file included from /opt/local/include/QtCore/qbytearray.h:45: In file included from /opt/local/include/QtCore/qatomic.h:46: /opt/local/include/QtCore/qbasicatomic.h:130:1: error: unknown type name 'template' template <typename T> ^ /opt/local/include/QtCore/qbasicatomic.h:130:10: error: expected identifier or '(' template <typename T> ^ In file included from qtterminal/qt_term.cpp:44: In file included from /opt/local/include/QtCore/QtCore:4: In file included from /opt/local/include/QtCore/qbitarray.h:45: In file included from /opt/local/include/QtCore/qbytearray.h:45: In file included from /opt/local/include/QtCore/qatomic.h:46: In file included from /opt/local/include/QtCore/qbasicatomic.h:227: In file included from /opt/local/include/QtCore/qatomic_arch.h:70: In file included from /opt/local/include/QtCore/qatomic_macosx.h:48: /opt/local/include/QtCore/qatomic_x86_64.h:52:8: error: unknown type name 'bool' inline bool QBasicAtomicInt::isReferenceCountingNative() ^ /opt/local/include/QtCore/qatomic_x86_64.h:52:1: error: 'inline' can only appear on functions inline bool QBasicAtomicInt::isReferenceCountingNative() ^ /opt/local/include/QtCore/qatomic_x86_64.h:52:28: error: expected ';' after top level declarator inline bool QBasicAtomicInt::isReferenceCountingNative() ^ ; /opt/local/include/QtCore/qatomic_x86_64.h:52:29: error: expected identifier or '(' inline bool QBasicAtomicInt::isReferenceCountingNative() ^ In file included from qtterminal/qt_term.cpp:44: In file included from /opt/local/include/QtCore/QtCore:4: In file included from /opt/local/include/QtCore/qbitarray.h:45: In file included from /opt/local/include/QtCore/qbytearray.h:45: /opt/local/include/QtCore/qatomic.h:124:1: error: unknown type name 'template' template <typename T> ^ /opt/local/include/QtCore/qatomic.h:124:10: error: expected identifier or '(' template <typename T> ^ /opt/local/include/QtCore/qatomic.h:194:1: error: unknown type name 'template' template <typename T> ^ /opt/local/include/QtCore/qatomic.h:194:10: error: expected identifier or '(' template <typename T> ^ In file included from qtterminal/qt_term.cpp:44: In file included from /opt/local/include/QtCore/QtCore:4: In file included from /opt/local/include/QtCore/qbitarray.h:45: In file included from /opt/local/include/QtCore/qbytearray.h:46: /opt/local/include/QtCore/qnamespace.h:1820:1: error: unknown type name 'class'; did you mean 'Class'? class Q_CORE_EXPORT QInternal { ^~~~~ Class note: 'Class' declared here /opt/local/include/QtCore/qnamespace.h:1820:20: error: expected ';' after top level declarator class Q_CORE_EXPORT QInternal { ^ ; In file included from qtterminal/qt_term.cpp:44: In file included from /opt/local/include/QtCore/QtCore:4: In file included from /opt/local/include/QtCore/qbitarray.h:45: /opt/local/include/QtCore/qbytearray.h:77:1: error: expected function body after function declarator Q_CORE_EXPORT char *qstrdup(const char *); ^ /opt/local/include/QtCore/qbytearray.h:79:8: error: unknown type name 'uint'; did you mean 'int'? inline uint qstrlen(const char *str) ^ /opt/local/include/QtCore/qbytearray.h:80:16: warning: implicit declaration of function 'uint' is invalid in C99 [-Wimplicit-function-declaration] { return str ? uint(strlen(str)) : 0; } ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 1 warning and 20 errors generated. make[3]: *** [qt_term.o] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
I'm not sure what is going on, but with pkg-config
I get
> pkg-config --cflags QtGui -DQT_SHARED -I/opt/local/include -I/opt/local/include/QtGui -I/opt/local/include/QtCore
since the file /opt/local/lib/pkgconfig/QtGui.pc
contains
prefix=/opt/local exec_prefix=${prefix} libdir=${prefix}/Library/Frameworks includedir=${prefix}/include/QtGui ... Name: Qtgui Description: Qtgui Library Version: 4.8.2 Libs: -F${libdir} -framework QtGui Cflags: -DQT_SHARED -I${prefix}/include -I${includedir} Requires: QtCore
Shouldn't the includedir be those Cflags be ${prefix}/Library/Frameworks/QtGui.framework/Headers
instead? (Or even better another variable like frameworkdir.) But maybe I'm wrong. And this probably wouldn't solve the reported problem anyway.
Change History (8)
comment:1 Changed 12 years ago by michaelld (Michael Dickens)
comment:2 Changed 12 years ago by mojca (Mojca Miklavec)
OK, maybe patching .pc files would indeed be an overkill for now. Gnuplot from macports seems to work. I need to figure out why the one from trunk + my patches doesn't.
comment:3 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | michaelld@… removed |
---|---|
Owner: | changed from macports-tickets@… to michaelld@… |
comment:4 Changed 12 years ago by robsonpeixoto@…
But the links are wrong.
lrwxr-xr-x 1 root admin 196 Jul 4 20:24 Qt3Support -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/Qt3Support.framework/Headers lrwxr-xr-x 1 root admin 195 Jul 4 20:24 QtCLucene -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtCLucene.framework/Headers lrwxr-xr-x 1 root admin 192 Jul 4 20:24 QtCore -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtCore.framework/Headers lrwxr-xr-x 1 root admin 192 Jul 4 20:24 QtDBus -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtDBus.framework/Headers lrwxr-xr-x 1 root admin 199 Jul 4 20:24 QtDeclarative -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtDeclarative.framework/Headers lrwxr-xr-x 1 root admin 196 Jul 4 20:24 QtDesigner -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtDesigner.framework/Headers lrwxr-xr-x 1 root admin 206 Jul 4 20:24 QtDesignerComponents -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtDesignerComponents.framework/Headers lrwxr-xr-x 1 root admin 191 Jul 4 20:24 QtGui -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtGui.framework/Headers lrwxr-xr-x 1 root admin 192 Jul 4 20:24 QtHelp -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtHelp.framework/Headers lrwxr-xr-x 1 root admin 198 Jul 4 20:24 QtMultimedia -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtMultimedia.framework/Headers lrwxr-xr-x 1 root admin 195 Jul 4 20:24 QtNetwork -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtNetwork.framework/Headers lrwxr-xr-x 1 root admin 194 Jul 4 20:24 QtOpenGL -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtOpenGL.framework/Headers lrwxr-xr-x 1 root admin 194 Jul 4 20:24 QtScript -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtScript.framework/Headers lrwxr-xr-x 1 root admin 199 Jul 4 20:24 QtScriptTools -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtScriptTools.framework/Headers lrwxr-xr-x 1 root admin 191 Jul 4 20:24 QtSql -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtSql.framework/Headers lrwxr-xr-x 1 root admin 191 Jul 4 20:24 QtSvg -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtSvg.framework/Headers lrwxr-xr-x 1 root admin 192 Jul 4 20:24 QtTest -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtTest.framework/Headers lrwxr-xr-x 1 root admin 195 Jul 4 20:24 QtUiTools -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtUiTools.framework/Headers lrwxr-xr-x 1 root admin 194 Jul 4 20:24 QtWebKit -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtWebKit.framework/Headers lrwxr-xr-x 1 root admin 191 Jul 4 20:24 QtXml -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtXml.framework/Headers lrwxr-xr-x 1 root admin 199 Jul 4 20:24 QtXmlPatterns -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/destroot/opt/local/Library/Frameworks/QtXmlPatterns.framework/Headers
comment:5 Changed 12 years ago by michaelld (Michael Dickens)
Use the patch from ticket #34864 to correct the links; you'll need to either revert to an earlier Qt, do the patch, then upgrade. Or, uninstall, patch, install.
comment:6 Changed 12 years ago by michaelld (Michael Dickens)
I've done an update in r96486 to qt4-mac; please update to this version and see if this issue still exists.
comment:7 Changed 12 years ago by mojca (Mojca Miklavec)
Yes, now it works for me, thank you very much.
pkg-config
would list -I/opt/local/include/QtGui
instead of corresponding Frameworks, but that's ok. And I still don't agree with files like QtGui.la
littering /opt/local/Library/Frameworks
, but they don't do any harm, so at least I have nothing to really complain about ... ;)
Thanks again for the hard work upgrading Qt to 4.8.
comment:8 Changed 12 years ago by michaelld (Michael Dickens)
Resolution: | → fixed |
---|---|
Status: | new → closed |
You're welcome! I'm glad it's now working (again). Thanks for reporting back. Let's leave the .la files in place for now and see how that works out. If need be, they can always be moved elsewhere in a future revision.
As long as the symlink works from ${prefix}/include/Qt* to its respective Frameworks/Qt*/Headers, then the above should work since most (all?) modern compilers know how to follow symlinks. Adding in a new variable to QMake-generated .pc files will be a pain, and I won't go there since I don't think it's truly necessary; using those that are commonly provided should be good enough. "install gnuplot +qt" works for me, with qt4-mac -framework. I'll try again once I have qt4-mac +framework installed.