c++ - Strange Qt include dir structure under OSX -


i experimenting qt headers (for using vim's clang-complete plugin). trying compile simple qt function (note: not supposed work, trying compile it).

#include <qwidget> int main(int, char**) {   qwidget* a; } 

i compile with

clang try.cpp -o try -dqt_gui_lib -dqt_widgets_lib -isystem/applications/qt/5.6/clang_64/lib/qtcore.framework/headers -isystem/applications/qt/5.6/clang_64/./mkspecs/macx-clang -isystem/applications/qt/5.6/clang_64/lib/qtgui.framework/headers -isystem/applications/qt/5.6/clang_64/lib/qtwidgets.framework/headers 

and error

in file included /applications/qt/5.6/clang_64/lib/qtwidgets.framework/headers/qwidget:1: /applications/qt/5.6/clang_64/lib/qtwidgets.framework/headers/qwidget.h:37:10: fatal error:    'qtgui/qwindowdefs.h' file not found #include <qtgui/qwindowdefs.h> 

this because qwidgets header has #include <qtgui/...> includes. ok instance in linux installations because folders set in order. in osx, folders have distinct structure. headers each module inside qt<module>.framework/headers/... instead of qt<module>/

how hell tell compiler includes are, using folder structure, if .h's qt apparently wrong folder structure?

as indicated - manatttta, qmake spec 'macx-clang' not expose header folders e.g. <qtcore/*.h>, in unix , windows configurations, because uses xcode framework architecture: e.g. <qtcore.framework/*.h>.

you can create alias (symlink) mapping qtcore.framework/headers qtcore. sure delete existing qt-generated makefile(s) subsequent build generate appropriate include paths. here example steps configure:

cd <myapp>/include  mkdir -p macosx/qt/headers  cd macosx/qt/headers  qt_core_headers=<your qt path verson subdirectory>/clang_64/lib/qtcore.framework/versions/5/headers  ln -s  $qt_core_headers qtcore  delete existing makefile `rm -f <myapp>/build/makefile` 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -