I'm having an issue with having qt4/qt5 coexisting on the same box. For the most part, both qt4 and qt5 programs run fine on my systems that I've tested them on. The one issue that I'm having is that when compiling certain programs, the header files for both qt4 and qt5 get mixed up. For example, I have an issue compiling calibre when qt5 is installed.
Code:
# ./calibre.Slackbuild
....
/usr/lib64/qt/include/QtCore/qmap.h:205:39: note: candidates are:
In file included from /usr/lib64/qt5/include/QtCore/qsharedpointer.h:50:0,
from /usr/lib64/qt/include/QtGui/qpixmap.h:49,
...
After some testing it looks to be the environment variable $CPLUS_INCLUDE_PATH which is defined in /etc/profile.d/qt4.sh and /etc/profile.d/qt5.sh. The way that it is set up on my system is that the qt5 header files come before the qt4 header files in $CPLUS_INCLUDE_PATH.
Code:
# echo $CPLUS_INCLUDE_PATH
/usr/lib64/qt5/include:/usr/lib64/qt/include
This doesn't seem to be an issue with CMAKE or autotools but only seems to happen when compiling with python or calling qmake explicitly (possibly others). The reverse is true that if qt4 headers come before qt5 headers in $CPLUS_INCLUDE_PATH, then qt5 programs will fail to compile for the same issue.
My question is, would it be prudent to just exclude CPLUS_INCLUDE_PATH from the qt5.{sh,csh} profile.d files and avoid any qt4/qt5 header collisions? or is there something more obvious that I'm missing?