LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-11-2013, 12:54 AM   #1
larryhaja
Member
 
Registered: Jul 2008
Distribution: Slackware 13.1
Posts: 305

Rep: Reputation: 80
Having issue with qt4/qt5 coexisting


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?
 
Old 12-11-2013, 03:42 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
How exactly have you installed both?

We had a little discussion about this a while back :-

http://www.linuxquestions.org/questi...-a-4175468237/

I'm currently waiting on the full release of 5.2 for further testing.
 
Old 12-11-2013, 11:23 PM   #3
larryhaja
Member
 
Registered: Jul 2008
Distribution: Slackware 13.1
Posts: 305

Original Poster
Rep: Reputation: 80
Quote:
Originally Posted by wildwizard View Post
How exactly have you installed both?
Similar to how qt4 is installed in stock Slackware. Everything is located in /usr/lib{,64}/qt5, with proper symlinks.
Quote:
Originally Posted by wildwizard View Post
We had a little discussion about this a while back :-

http://www.linuxquestions.org/questi...-a-4175468237/
Yes, I'm aware of that thread. I do see that in your slackbuild you don't use profile.d files.
 
Old 12-12-2013, 02:01 AM   #4
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
I think I see exactly what has caused your setup to explode.

When you compile any large project these days the configure scripts use pkg-config to get information about installed libraries, how to compile against and how to link against them.

eg If I run the following :-
Code:
michael@indigo:~$ pkg-config --cflags QtCore
-DQT_SHARED -I/usr/lib64/qt/include -I/usr/lib64/qt/include/QtCore
We get the include path used to compile against QtCore for Qt4

When you set the CPLUS include directory as you have you confuse the compiler as it now has the path to everything, even things you don't intend to use.

This is why I have gone away from a profile script for Qt 5 as it is no longer required when you install it as I have.

Qt 4 only needs it so far as setting the pkg-config path if you don't otherwise copy the pkg-config files into the existing /usr/lib{64}/pkgconfig directory.

Even the symlinks to the libs in the Qt 4 package are not used as things like KDE that use Qt have the full path to the library as that is what pkg-config gave it when it was compiled.
 
Old 12-12-2013, 11:14 PM   #5
larryhaja
Member
 
Registered: Jul 2008
Distribution: Slackware 13.1
Posts: 305

Original Poster
Rep: Reputation: 80
Well, I just removed CPLUS_INCLUDE_PATH from the profile.d files and all is well.

qt 5.2.0 just came out. Testing it now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Qt5 on Slackware-14.1 Clementine Jam Slackware 10 12-21-2013 05:34 PM
LXer: VLC 2.1 Is Now Available: Qt5 Happy, Audio Improvements LXer Syndicated Linux News 0 09-26-2013 12:10 AM
qt4.Slackbuild problems compiling qt4 Stragonian Slackware 3 11-26-2010 04:31 PM
using cmake: "could not find qtglobal header". Issue with qt4? perturbed Linux - Newbie 1 01-20-2009 01:38 PM
Compiling qt4 apps for non-qt4 linux, win, mac birdseye Programming 4 10-31-2005 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration