Discussion:
[blfs-support] Book 7.7 QtCore/QtGlobal KDE . No such file or directory
Wayne Sallee
2016-08-27 14:04:34 UTC
Permalink
I've run into a problem building phonon-backend-gstreamer-4.8.2 for KDE.

I'm getting:
fatal error: QtCore/QtGlobal: No such file or directory
#include <QtCore/QtGlobal>



phonon-backend-gstreamer-4.8.2/build/CMakeTmp/check_qt_visibility.cpp

#include <QtCore/QtGlobal>
int main()
{
#ifndef QT_VISIBILITY_AVAILABLE
#error QT_VISIBILITY_AVAILABLE is not available
#endif
}



I have both qt4 and qt5 built using the opt method.

The file QtCore/QtGlobal is in both 4 and 5

/usr/src/qt/qt-everywhere-opensource-src-4.8.6/include/QtCore/QtGlobal
/usr/src/qt/qt-everywhere-opensource-src-5.4.0/qtbase/include/QtCore/QtGlobal

What would be a command that I could run to test to see what's going on?

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above
Bruce Dubbs
2016-08-27 16:12:47 UTC
Permalink
Post by Wayne Sallee
I've run into a problem building phonon-backend-gstreamer-4.8.2 for KDE.
fatal error: QtCore/QtGlobal: No such file or directory
#include <QtCore/QtGlobal>
phonon-backend-gstreamer-4.8.2/build/CMakeTmp/check_qt_visibility.cpp
#include <QtCore/QtGlobal>
int main()
{
#ifndef QT_VISIBILITY_AVAILABLE
#error QT_VISIBILITY_AVAILABLE is not available
#endif
}
I have both qt4 and qt5 built using the opt method.
The file QtCore/QtGlobal is in both 4 and 5
/usr/src/qt/qt-everywhere-opensource-src-4.8.6/include/QtCore/QtGlobal
/usr/src/qt/qt-everywhere-opensource-src-5.4.0/qtbase/include/QtCore/QtGlobal
What would be a command that I could run to test to see what's going on?
How is your PKG_CONFIG_PATH set up? I have something like
/opt/qt5/lib/pkgconfig. There is a file there, Qt5Core.pc which has:

prefix=/opt/qt5
...
includedir=${prefix}/include
...
Cflags: -I${includedir}/QtCore -I${includedir}

The QtCore in that you are looking at is for Qt4 so yours should be
slightly different. The configure command should use pkgconfig to set up
the -I entries to tell the compiler where to find include files.

-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the abov
Wayne Sallee
2016-08-27 16:46:20 UTC
Permalink
Post by Wayne Sallee
I have both qt4 and qt5 built using the opt method.
The file QtCore/QtGlobal is in both 4 and 5
/usr/src/qt/qt-everywhere-opensource-src-4.8.6/include/QtCore/QtGlobal
/usr/src/qt/qt-everywhere-opensource-src-5.4.0/qtbase/include/QtCore/QtGlobal
Oops I copied the wrong 2 lines from the locate command. :-)

The files are located at:
/opt/qt-4.8.6/include/QtCore/QtGlobal
/opt/qt-5.4.0/include/QtCore/QtGlobal


Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.htm
Wayne Sallee
2016-08-27 18:35:26 UTC
Permalink
How is your PKG_CONFIG_PATH set up? I have something like /opt/qt5/lib/pkgconfig. There is a file there, Qt5Core.pc
prefix=/opt/qt5
...
includedir=${prefix}/include
...
Cflags: -I${includedir}/QtCore -I${includedir}
The QtCore in that you are looking at is for Qt4 so yours should be slightly different. The configure command should
use pkgconfig to set up the -I entries to tell the compiler where to find include files.
-- Bruce
root [ ~ ]# cat /opt/qt-4.8.6/include/QtCore/QtGlobal
#include "qglobal.h"
root [ ~ ]# cat /opt/qt-5.4.0/include/QtCore/QtGlobal
#include "qglobal.h"
root [ ~ ]#





root [ ~ ]# find /opt/qt4/lib/pkgconfig/*Core*
/opt/qt4/lib/pkgconfig/QtCore.pc
root [ ~ ]# cat /opt/qt4/lib/pkgconfig/QtCore.pc
prefix=/opt/qt-4.8.6
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/QtCore
qt_config=lex yacc warn_on uic resources qt warn_on release incremental link_prl gdb_dwarf_index shared
def_files_disabled exceptions no_mocdepend release stl qt_no_framework system-sqlite release largefile stl
precompile_header mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx dylib create_prl link_prl depend_includepath
QTDIR_build qt_install_headers qt warn_on depend_includepath qmake_cache target_qt hide_symbols create_pc create_libtool
explicitlib moc thread dll shared
moc_location=${prefix}/bin/moc
uic_location=${prefix}/bin/uic
rcc_location=${prefix}/bin/rcc
lupdate_location=${prefix}/bin/lupdate
lrelease_location=${prefix}/bin/lrelease

Name: Qtcore
Description: Qtcore Library
Version: 4.8.6
Libs: -L${libdir} -lQtCore
Libs.private: -L/opt/qt-4.8.6/lib -lpthread -lz -lm -ldl -lgthread-2.0 -pthread -lglib-2.0 -lrt
Cflags: -DQT_SHARED -I/opt/qt-4.8.6/include -I${includedir}






root [ ~ ]# find /opt/qt5/lib/pkgconfig/*Core*
/opt/qt5/lib/pkgconfig/Qt5Core.pc
root [ ~ ]# cat /opt/qt5/lib/pkgconfig/Qt5Core.pc
prefix=/opt/qt-5.4.0
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

host_bins=${prefix}/bin
qt_config=minimal-config small-config medium-config large-config full-config gtk2 gtkstyle fontconfig libudev evdev xlib
xrender xcb-plugin xcb-render xcb-glx xcb-xlib xcb-sm xkbcommon-qt accessibility-atspi-bridge linuxfb kms c++11
accessibility egl egl_x11 eglfs opengl shared qpa reduce_exports reduce_relocations clock-gettime clock-monotonic
posix_fallocate mremap getaddrinfo ipv6ifname getifaddrs inotify eventfd system-jpeg system-png png system-freetype
harfbuzz system-zlib mtdev cups iconv glib dbus dbus-linked openssl-linked xcb xinput2 rpath alsa pulseaudio icu
concurrent audio-backend release

Name: Qt5 Core
Description: Qt Core module
Version: 5.4.0
Libs: -L${libdir} -lQt5Core
Libs.private: -lpthread -lz -licui18n -licuuc -licudata -lpcre16 -lm -ldl -lgthread-2.0 -pthread -lglib-2.0 -lrt
Cflags: -I${includedir}/QtCore -I${includedir}


Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above in
Bruce Dubbs
2016-08-27 20:06:11 UTC
Permalink
Post by Wayne Sallee
Post by Bruce Dubbs
How is your PKG_CONFIG_PATH set up? I have something like
prefix=/opt/qt5
...
includedir=${prefix}/include
...
Cflags: -I${includedir}/QtCore -I${includedir}
The QtCore in that you are looking at is for Qt4 so yours should be
slightly different. The configure command should use pkgconfig to set
up the -I entries to tell the compiler where to find include files.
-- Bruce
root [ ~ ]# cat /opt/qt-4.8.6/include/QtCore/QtGlobal
#include "qglobal.h"
root [ ~ ]# cat /opt/qt-5.4.0/include/QtCore/QtGlobal
#include "qglobal.h"
root [ ~ ]#
root [ ~ ]# find /opt/qt4/lib/pkgconfig/*Core*
/opt/qt4/lib/pkgconfig/QtCore.pc
root [ ~ ]# cat /opt/qt4/lib/pkgconfig/QtCore.pc
prefix=/opt/qt-4.8.6
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/QtCore
qt_config=lex yacc warn_on uic resources qt warn_on release incremental
link_prl gdb_dwarf_index shared def_files_disabled exceptions no_mocdepend
release stl qt_no_framework system-sqlite release largefile stl
precompile_header mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx dylib
create_prl link_prl depend_includepath QTDIR_build qt_install_headers qt
warn_on depend_includepath qmake_cache target_qt hide_symbols create_pc
create_libtool explicitlib moc thread dll shared
moc_location=${prefix}/bin/moc
uic_location=${prefix}/bin/uic
rcc_location=${prefix}/bin/rcc
lupdate_location=${prefix}/bin/lupdate
lrelease_location=${prefix}/bin/lrelease
Name: Qtcore
Description: Qtcore Library
Version: 4.8.6
Libs: -L${libdir} -lQtCore
Libs.private: -L/opt/qt-4.8.6/lib -lpthread -lz -lm -ldl -lgthread-2.0
-pthread -lglib-2.0 -lrt
Cflags: -DQT_SHARED -I/opt/qt-4.8.6/include -I${includedir}
root [ ~ ]# find /opt/qt5/lib/pkgconfig/*Core*
/opt/qt5/lib/pkgconfig/Qt5Core.pc
root [ ~ ]# cat /opt/qt5/lib/pkgconfig/Qt5Core.pc
prefix=/opt/qt-5.4.0
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
host_bins=${prefix}/bin
qt_config=minimal-config small-config medium-config large-config
full-config gtk2 gtkstyle fontconfig libudev evdev xlib xrender xcb-plugin
xcb-render xcb-glx xcb-xlib xcb-sm xkbcommon-qt accessibility-atspi-bridge
linuxfb kms c++11 accessibility egl egl_x11 eglfs opengl shared qpa
reduce_exports reduce_relocations clock-gettime clock-monotonic
posix_fallocate mremap getaddrinfo ipv6ifname getifaddrs inotify eventfd
system-jpeg system-png png system-freetype harfbuzz system-zlib mtdev cups
iconv glib dbus dbus-linked openssl-linked xcb xinput2 rpath alsa
pulseaudio icu concurrent audio-backend release
Name: Qt5 Core
Description: Qt Core module
Version: 5.4.0
Libs: -L${libdir} -lQt5Core
Libs.private: -lpthread -lz -licui18n -licuuc -licudata -lpcre16 -lm -ldl
-lgthread-2.0 -pthread -lglib-2.0 -lrt
Cflags: -I${includedir}/QtCore -I${includedir}
How about 'echo $PKG_CONFIG_PATH'?

-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Un
Wayne Sallee
2016-08-29 22:35:08 UTC
Permalink
Post by Bruce Dubbs
How about 'echo $PKG_CONFIG_PATH'?
-- Bruce
echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig:/opt/qt4/lib/pkgconfig:/opt/qt5/lib/pkgconfig


Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above inform
Ken Moffat
2016-08-29 23:34:58 UTC
Permalink
Post by Bruce Dubbs
Post by Bruce Dubbs
How about 'echo $PKG_CONFIG_PATH'?
-- Bruce
echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig:/opt/qt4/lib/pkgconfig:/opt/qt5/lib/pkgconfig
Try changing it so that 5 is ahead of 4, or just omit 4 when
building with 5 (and vice versa if you still have something which
needs 4) : using both in a build has always been painful.

Actually, I'm tempted to suggest that building qt packages hs always
been painful, but for the moment I won't suggest that.

Another thought: non-qt packages have used /usr/share/pkgconfig as
well as lib for many years - you might need to add
/usr/local/share/pkgconfig one day if you actually use /usr/local -
for me, /usr/local is rarely worth the pain (e.g. in regular include
files it gets searched before /usr).

ĸen
--
`I shall take my mountains', said Lu-Tze. `The climate will be good
for them.' -- Small Gods
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/bl
Wayne Sallee
2016-08-30 13:41:53 UTC
Permalink
Post by Ken Moffat
Try changing it so that 5 is ahead of 4, or just omit 4 when
building with 5 (and vice versa if you still have something which
needs 4) : using both in a build has always been painful.
I have already tried a variety of such methods, with no improvement.

Often in debugging it helps to go to the root of the error. Any idea of some good qt commands that will move me to the
root of the error?

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscrib
Wayne Sallee
2016-08-30 17:32:47 UTC
Permalink
I got it working by adding:

-DQT_QMAKE_EXECUTABLE=/opt/qt4/bin/qmake

Info found in:
https://ubuntuforums.org/showthread.php?t=2168435

So the modified cmake command was:

cmake -DCMAKE_INSTALL_PREFIX=$KDE_PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release
-DQT_QMAKE_EXECUTABLE=/opt/qt4/bin/qmake -Wno-dev ..



Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information
Wayne Sallee
2016-08-30 17:44:10 UTC
Permalink
And thanks for everyone's help, as y'all pointed out it was a problem with both versions of qt being found.

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Uns
Bruce Dubbs
2016-08-30 17:45:39 UTC
Permalink
Post by Wayne Sallee
-DQT_QMAKE_EXECUTABLE=/opt/qt4/bin/qmake
https://ubuntuforums.org/showthread.php?t=2168435
cmake -DCMAKE_INSTALL_PREFIX=$KDE_PREFIX
-DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release
-DQT_QMAKE_EXECUTABLE=/opt/qt4/bin/qmake -Wno-dev ..
That should not have been needed if the PATH was set properly.

A simple 'which qmake' should tell you the default version.

-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/fa
Loading...