Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with qt5 #35

Open
nick87720z opened this issue Jan 5, 2014 · 18 comments
Open

Compilation error with qt5 #35

nick87720z opened this issue Jan 5, 2014 · 18 comments

Comments

@nick87720z
Copy link

qt5/style/qrgbhelper.cpp has line:

include "private/qwidget_p.h". Should it be in <> instead of ""?

@yuyichao
Copy link
Member

yuyichao commented Jan 5, 2014

That should be fine.
What's the compile error and are you sure you have QtWidgets private headers installed?

@nick87720z
Copy link
Author

There is dir with private headers:
/usr/include/qt5/QtWidgets/5.2.0/QtWidgets/private

Including necessary header.
"" is usually used for headers in source dir. For system dirs or those, added with compiler option -I, should be <>.

i.e.: "" is path relative including file, not in -I and other system dirs

@yuyichao
Copy link
Member

yuyichao commented Jan 5, 2014

So what exactly is the compile error.
I think if the header is not found in current directory, the compiler will search it again in system path.

Quoted from cplusplus.com

The syntax used in the second #include uses quotes, and includes a file. The file is searched for in an
implementation-defined manner, which generally includes the current path. In the case that the file is not found,
the compiler interprets the directive as a header inclusion, just as if the quotes ("") were replaced by
angle-brackets (<>).

@nick87720z
Copy link
Author

Hm, tried for self. Error doesn't disappear.

@yuyichao
Copy link
Member

yuyichao commented Jan 5, 2014

You can paste the error output of the compiler, this should help narrowing down the problem.

Also, if you think there is any problem with include path running make VERBOSE=1 should help figuring out what exactly command is used.

If you have changed compile options or have compiled with different Qt5 versions, remove CMakeCache.txt and compile again may help.

@nick87720z
Copy link
Author

[ 92%] Building CXX object qt5/style/CMakeFiles/qtcurve-qt5.dir/argbhelper.cpp.o
cd /var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999_build/qt5/style && /usr/bin/x86_64-pc-linux-gnu-g++ -DQTC_UTILS_QT5 -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_DISABLE_DEPRECATED_BEFORE=0x050100 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_PLUGIN -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -D_BSD_SOURCE -Dqtcurve_qt5_EXPORTS -DNDEBUG -O2 -march=native -mtune=native -pipe -msse4 -msse4.1 -msse4.2 -mavx -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra '-std=c++0x' -fPIC -I/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999_build -I/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999_build/.cmake_utils_base/cmake_c_macros/include_fix -I/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999/qt5 -I/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999_build/qt5 -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/lib64/qt5/mkspecs/linux-g++ -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtSvg -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtDBus -I/usr/include/qt5/QtX11Extras -I/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999/qt5/style -I/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999_build/qt5/style -D_GNU_SOURCE -pthread -o CMakeFiles/qtcurve-qt5.dir/argbhelper.cpp.o -c /var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999/qt5/style/argbhelper.cpp
/var/calculate/tmp/portage/x11-themes/qtcurve-9999/work/qtcurve-9999/qt5/style/argbhelper.cpp:25:31: fatal error: private/qwidget_p.h: No such file or directory

@nick87720z
Copy link
Author

Ha, already found. It includes /usr/include/qt5/QtWidgets, but there are more two dirs to dive to :) (5.2.0/QtWidgets).

@yuyichao
Copy link
Member

yuyichao commented Jan 5, 2014

It should be taken care of by this. You should first try removing CMakeCache.txt and if it doesn't work, print that cmake variable with message("${Qt5Widgets_PRIVATE_INCLUDE_DIRS}") and see if it has the right directories in it.

@nick87720z
Copy link
Author

It is empty. I guessed misprinting, since most other DIR variables are ending with "_DIR", not "_DIRS", but without S at the end result is same.

I found such variable mentioned only in one place in web: http://qt-project.org/forums/viewthread/23190

@nick87720z
Copy link
Author

Tried manually clone and build only with qt5. Same. The only way, i found for self is to set this variable in pointed CMakeList.txt, filling with two path, where second is for QtCore ptivate include dir. Did not install yet.

Using qt 5.2.0
I guess, this variable is deprecated, but could be got using other known, not private paths.

Hm, found mentioned in Qt5WidgetsConfig.cmake.

@nick87720z
Copy link
Author

I looked better to cmake output, trying to configure only with qt5 and only with qt4.
In both cases it says in begining: found Qt-Version 4.8.5 (using /usr/bin/qmake) after lines about Q_WS_*.
But for qt4 it prints it again after "xcb; x11-xcb" check.

All options are -DENABLE_QT5=yes -DENABLE_QT4=no -DENABLE_GTK2=no -DQTC_QT4_ENABLE_KDE=no, where only one of first two is enabled. Others are autodetected.

@nick87720z
Copy link
Author

https://bugs.archlinux.org/task/36988
still unsure

@yuyichao
Copy link
Member

yuyichao commented Jan 6, 2014

.... None of them are related.....
The first Qt4 check is for figuring out KDE prefix.
And the bug report is just invalid (it just says you should use this variable.)

@yuyichao
Copy link
Member

yuyichao commented Jan 6, 2014

I'm using Qt5.2.0rc1 (haven't updated yet because of network problems) and it compiles fine. I also checked the cmake module of 5.2.0 and rc1 and they looks the same.

@yuyichao
Copy link
Member

yuyichao commented Jan 6, 2014

I'm still not sure what's the problem and I need to leave now.
If you would like to debug this yourself, the only thing I can suggest is to trace the cmake module of Qt5Widgets and print this variable at different places to see if it is properly set.

@nick87720z
Copy link
Author

Looks like not qtcurve bug. In foreach block, finding each package and doing some inits, *_INCLUDE_DIRS are filled, but *_PRIVATE_INCLUDE_DIRS are empty.

@ff2000
Copy link

ff2000 commented Jan 29, 2014

Same issue here, I am also a Gentoo user. Probably Gentoo is doing something wrong with its Qt5 install.
Qt4 installs its private headers under (e.g.) /usr/include/qt4/QtCore/private. Qt5 puts them into /usr/include/qt5/QtCore/5.2.0/QtCore/private. This looks really suspicious - as if it did not get the proper install directory right...

@ff2000
Copy link

ff2000 commented Jan 31, 2014

I think it is intended that those paths look like this.
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri etc.
seem to manage it that way.

I also reported this issue in the gentoo bug tracker:
https://bugs.gentoo.org/show_bug.cgi?id=499882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants