Conflicting targets during Qt6.4.1 build - qt

I'm trying to build qt from sources but it fails curing configure stage, saying about conflicting targets.
After cloning 6.4.1 branch from official repo, I tried to configure it using configure.bat from x64 Native Tools Command Prompt VS 2022
c:\Qt\Qt6.4.1>configure -debug-and-release -prefix %CD%/qtbase -opensource -opengl desktop -nomake examples -nomake tests
It prints such errors about different building targets:
...
CMake Error at build/qtbase/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2066 (add_library):
add_library cannot create target "Bundled_Poly2Tri" because another target
with the same name already exists. The existing target is a static library
created in source directory
"C:/Qt/Qt6.4.1/qtlocation/src/3rdparty/poly2tri". See documentation for
policy CMP0002 for more details.
Call Stack (most recent call first):
qtbase/cmake/Qt3rdPartyLibraryHelpers.cmake:52 (_qt_internal_add_library)
qtbase/cmake/Qt3rdPartyLibraryHelpers.cmake:163 (qt_internal_add_common_qt_library_helper)
qtpositioning/src/3rdparty/poly2tri/CMakeLists.txt:7 (qt_internal_add_3rdparty_library)
...
CMake Error at build/qtbase/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:329 (message):
Output directory for target "PositioningQuick" is already used by another
QML module (target "PositioningQuick"). Output directory is:
C:/Qt/Qt6.4.1/build/qtbase/qml/QtPositioning
Call Stack (most recent call first):
build/qtbase/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:317 (qt6_add_qml_module)
qtpositioning/src/positioningquick/CMakeLists.txt:7 (qt_internal_add_qml_module)
-- Configuring incomplete, errors occurred!
See also "C:/Qt/Qt6.4.1/build/CMakeFiles/CMakeOutput.log".
See also "C:/Qt/Qt6.4.1/build/CMakeFiles/CMakeError.log".
CMake Error at C:/Qt/Qt6.4.1/qtbase/cmake/QtProcessConfigureArgs.cmake:965 (message):
CMake exited with code 1.
Edit:
I also tried 6.3 and Linux, same issue.

I also ran into this issue on Debian 11 with Qt6.2.4 and Qt6.4.2. I ended up disabling qtlocation with -skip qtlocation in the configure.

Related

Building open source project(Mumble) in Qt via CMake on Windows

I'm attempting to build Mumble on my Windows 10 PC in Qt, and I'm running into some issues (I think I'm just a bit lost on some of the Qt, CMake, and build lingo). I've installed all of the required Qt packages through VCPKG, and I've built the program with almost no issues through the "x64 Native Tools Command Prompt for VS 2019"...
Here is the build documentation that Mumble provides.
I believe what's got me particularly confused is the CMake process. After getting the necessary packages installed, the Mumble instructions have you run the following cmake -G command.
cmake -G "NMake Makefiles" "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md" "-Dstatic=ON" "-DCMAKE_TOOLCHAIN_FILE=D:\Users\Skewb\Documents\repos\vcpkg\scripts\buildsystems\vcpkg.cmake" "-DIce_HOME=D:\Users\Skewb\Documents\repos\vcpkg\installed\x64-windows-static-md" "-DCMAKE_BUILD_TYPE=Release" ..
Followed by the actual "build" command:
cmake --build .
From what I can tell, there's no place for me to input the cmake -G command in the "Build Settings" page. Here's where I've attempted to input it. I've been through the errors below, but I think my lack of understanding of cmake --build and cmake -G has made looking at these files unnecessary.
If I've somehow gotten that correct (I haven't), here's the error I'm getting. It's unable to find the "Ice" directory, but I've specified it in that command.
-- Qt5 component found: Widgets | Version: 5.15.2
CMake Error at cmake/pkg-utils.cmake:87 (message):
Ice component not found: Ice
Call Stack (most recent call first):
src/murmur/CMakeLists.txt:267 (find_pkg)
-- Configuring incomplete, errors occurred!
See also "C:/Users/skewb/AppData/Local/Temp/QtCreator-CfECuA/qtc-cmake-Kjqhpyja/CMakeFiles/CMakeOutput.log".
See also "C:/Users/skewb/AppData/Local/Temp/QtCreator-CfECuA/qtc-cmake-Kjqhpyja/CMakeFiles/CMakeError.log".
CMake process exited with exit code 1.
Elapsed time: 00:55.
I've also gone through these instructions and found the "CMake generator" option in the "Kits" settings, but I don't see anywhere to change the options you feed it:
I think I'm conflating a bunch of terms and their uses in the Mumble documentation vs. Qt including, but not limited to:
Build
Make
Run
Clean
Any help understanding this issue would be greatly appreciated.

How to build Qmake for Visual studio project? specifically for QGLViewer for octomap library

I need to build an octomap on visual studio 2017. According to website they have asked to do the following
open a windows shell (e.g., from the START-Menu -> QT)
cd octovis/src/extern/QGLViewer
qmake -t vclib QGLViewer.pro -spec win32-msvc2010 (ignore any warnings)
So I did the same but in windows command prompt terminal and when I feed the above commands it throws the following error:
#qmake -t vclib QGLViewer.pro -spec win32-msvc2010
Could not find qmake spec 'win32-msvc2010'.
Error processing project file: QGLViewer.pro
#qmake -t vclib QGLViewer.pro -spec win32-msvc2017
Could not find qmake spec 'win32-msvc2017'.
Error processing project file: QGLViewer.pro
What should I do in order to configure and generate a QGLViewer.vcxproj?
Additional details:
Project location : "C:\software\octomap-1.9.0\octomap-1.9.0\octovis\src\extern\QGLViewer"
qmake location : C:\vcpkg\packages\qt5-base_x64-windows\tools\qt5
Visual studio : 2017 ( Version 15.9.8)
Any help in regards to this would be much appreciated as I have a very limited understanding on qmake.
You can build QGLViewer with Qt Creator instead, and then it just works - I was bashing my head against the same issue as you for a while, but then just tried that and it solved my problems. For what it's worth, I used Qt Creator 4.12.4 and did a build all.
I had a few other issues building Octovis on Windows that you might run up against as well. See here for the changes I had to make: https://github.com/OctoMap/octomap/compare/devel...sgolodetz:winchanges

Building Supercollider from source, wrong version of qt.

I have Linux Mint 19, and i really want to install SuperCollider. I cant do it by apt-get, because there is old version which do not support SuperDirt. I need to build it from source. I use this guide:
https://github.com/supercollider/supercollider/wiki/Installing-SuperCollider-from-source-on-Ubuntu
Problem is with cmake:
cmake -qt=qt5.11 -DSC_EC=ON -DSC_EL=OFF -DSC_WII=OFF -DSC_IDE=ON ..
-- SuperCollider Version: 3.10.0-beta2
-- Building from branch develop, commit hash is f543f53
-- Build type defaulting to "RelWithDebInfo"
-- Compiling with Qt GUI
-- building boost libraries manually
-- using bundled libyaml-cpp
-- HIDAPI components:
-- linux hidraw
-- libudev stable: 1
-- Found UDev: /usr/lib/x86_64-linux-gnu/libudev.so
-- include: /usr/include
-- hidapi_parser
-- Building with HID support
-- Using fftw3f
-- Found jack: /usr/lib/x86_64-linux-gnu/libjack.so
-- Audio API: jack
-- Found GNU Readline version 6.3: /usr/lib/x86_64-linux-gnu/libreadline.so
CMake Error at QtCollider/CMakeLists.txt:3 (find_package):
Could not find a configuration file for package "Qt5" that is compatible
with requested version "5.7".
The following configuration files were considered but not accepted:
/usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.5.1
Call Stack (most recent call first):
lang/CMakeLists.txt:155 (include)
-- Configuring incomplete, errors occurred!
See also "/home/nedlo/programming/supcol/bsource/supercollider/build/CMakeFiles/CMakeOutput.log".
So i need at least qt5.7, but i have qt5.5.1 I dont know how to update qt. I installed Qt Creator 5.11, but how do i "show" cmake that i should use qt5.11, if it automatically checks path to /usr/lib/.../qt5 which has qt5.5.1? What am i supposed to do?
Set CMAKE_PREFIX_PATH to the directory in your Qt installation that contains bin, lib, include, etc. It typically looks something like this:
cmake -DCMAKE_PREFIX_PATH=/opt/Qt/5.11.2/gcc_64 ...

Running Qt application under wayland

Running:
./myapp -platform wayland
gives:
This application failed to start because it could not find or load the
Qt platform plugin "wayland" in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl,
offscreen, vnc, xcb.
Reinstalling the application may fix this problem. Aborted (core
dumped)
Following the instructions: How to build qtwayland?
Running qmake gives:
Running configuration tests...
Done running configuration tests.
Configure summary:
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
The qtwayland README indicates 2 dependencies:
xkbcommon 0.2.0 - http://xkbcommon.org/
wayland 1.6.0 - http://wayland.freedesktop.org/
On fedora 28, libxkbcommon is installed by default. In addition I also installed libxkbcommon-devel
dnf whatprovides *wayland*
returns no results, although my gnome session is running under wayland.
I see I can download wayland from https://wayland.freedesktop.org/releases.html.
I downloaded and decompressed 1.15, but not sure what to do with decompressed source: do I build it? do I need to put it somewhere where qtwayland can find it?
I see that the following file exists by default in fedora 28:
/usr/lib64/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
But copying it to ~/Qt/5.10.1/gcc_64/plugins/platforms
does not resolve my application startup errors.
Question: how to get my Qt application to run under wayland?
Added in response to bobbaluba questions below:
Am trying to build QtWayland against the official Qt Binaries because it is not included.
Installed wayland-devel as suggested, but qmake still reported no configure for Qt Wayland Client, as per the message above.
Tried to install qt5-qtwayland using dnf, which reported:
Package qt5-qtwayland-5.10.1-2.fc28.x86_64 is already installed, skipping.
The following might be relevant:
? sudo dnf whatprovides libwayland-egl.so
Last metadata expiration check: 0:18:44 ago on Wed 09 May 2018 09:15:20 PM +08.
qt5-qtwayland-5.10.1-2.fc28.i686 : Qt5 - Wayland platform support and QtCompositor module
Repo : fedora
Matched from:
Provide : libwayland-egl.so
? find / -name libwayland-egl.so* -print
/usr/lib64/libwayland-egl.so
/usr/lib64/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
? sudo ldconfig -p | grep wayland-egl
libwayland-egl.so.1 (libc6,x86-64) => /lib64/libwayland-egl.so.1
libwayland-egl.so (libc6,x86-64) => /lib64/libwayland-egl.so
Installed Qt 5.11.0rc which resulted in
~/Qt/5.11.0/gcc_64/plugins/wayland-graphics-integration-server/libwayland-egl.so
~/Qt/5.11.0/gcc_64/plugins/wayland-graphics-integration-server/libwayland-egl.so.debug
being added to ~/Qt/5.11.0/gcc_64/plugins/platforms.
cmake's CMakeFile.txt suddenly stopped working when I installed Qt5.11rc - with gcc unable to find Qt headers like QDate.
Tried compiling the example project 'addressbook' using Qt5.11 and got:
QSocketNotifier: Can only be used with threads started with QThread
Using Wayland-EGL
Using the 'xdg-shell-v6' shell integration
In short, using the Qt5.11rc seems to resolve the issue.
Why does configuring QtWayland fail?
I'm assuming (correct me if I'm wrong) that you are trying to build QtWayland against official Qt binaries that do not include QtWayland.
Do you have development packages installed? In your case I think it should be wayland-devel.
Btw, the libwayland-egl.so you see, is your distro's version of the qt wayland-egl buffer integration (and not the same as the libwayland-egl.so dependency which qmake complains is missing). However, you should still be able to build QtWayland without wayland-egl, so I'm not sure what this is about.
Other options:
1. Use official QtWayland binaries
You are probably running into this problem because Qt packages did not previously include QtWayland.
However, starting with Qt 5.11.0 the official Qt binaries should include QtWayland, so the easiest thing would probably be to install Qt 5.11.0 or newer.
2. Use the distro's version of Qt (and Qt Wayland)
Install and use Qt from the distro, make sure you also install qtwayland (on Fedora I think it's qt5-qtwayland).

Cmake can't find Qt OpenGL library

I'm trying to compile a project using cmake. The instructions given to me was that Qt 4.8 is needed. Downloaded it from qt-project.org/downloads. Compiled and installed Qt 4.8:
mazdak#lnxamindai> qmake -query
QT_INSTALL_PREFIX:/usr/local/Trolltech/Qt-4.8.5
QT_INSTALL_DATA:/usr/local/Trolltech/Qt-4.8.5
QT_INSTALL_DOCS:/usr/local/Trolltech/Qt-4.8.5/doc
QT_INSTALL_HEADERS:/usr/local/Trolltech/Qt-4.8.5/include
QT_INSTALL_LIBS:/usr/local/Trolltech/Qt-4.8.5/lib
QT_INSTALL_BINS:/usr/local/Trolltech/Qt-4.8.5/bin
QT_INSTALL_PLUGINS:/usr/local/Trolltech/Qt-4.8.5/plugins
QT_INSTALL_IMPORTS:/usr/local/Trolltech/Qt-4.8.5/imports
QT_INSTALL_TRANSLATIONS:/usr/local/Trolltech/Qt-4.8.5/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/local/Trolltech/Qt-4.8.5/examples
QT_INSTALL_DEMOS:/usr/local/Trolltech/Qt-4.8.5/demos
QMAKE_MKSPECS:/usr/local/Trolltech/Qt-4.8.5/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.5
However, when compiling the project I received the following error:
root#lnxamindai> cmake .
-- Setting flags for GNU GCC
-- REQUIRED_VARS (missing: QTMOBILITY_INCLUDE_DIR QTMOBILITY_MULTIMEDIAKIT_INCLUDE_DIR QTMOBILITY_MULTIMEDIAKIT_LIBRARY VERSION_VAR QTMOBILITY_VERSION)
Qt QTOPENGL library not found.
-- Buiding ManyEarsLib Library...
-- Buiding RTAudio Library...
-- Found jack: /usr/lib/libjack.so
ALSA lib : -lasound -lpthread
Qt QTOPENGL library not found.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/mazdak/dev/ManyEars/manyears/QtGUI
QTMOBILITY_MULTIMEDIAKIT_LIBRARY (ADVANCED)
linked by target "ManyEars" in directory /home/mazdak/dev/ManyEars/manyears/QtGUI
-- Configuring incomplete, errors occurred!
CMakeLists.txt:
(...)
IF (NOT MANYEARS_GUI_DISABLED)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTSVG TRUE)
SET(QT_USE_QTXML TRUE)
SET(QT_USE_QTSCRIPT TRUE)
SET(QT_USE_QTOPENGL TRUE)
SET(QT_USE_QTMULTIMEDIA TRUE)
find_package(QtMobility COMPONENTS MultimediaKit)
find_package(Qt4 4.8.0 QUIET)
if (QTMOBILITY_FOUND)
MESSAGE("QT_MOBILITY_INCLUDE_DIR : ${QTMOBILITY_INCLUDE_DIRS} QT_MOBILITY_LIB: ${QTMOBILITY_LIBRARIES}")
ENDIF (QTMOBILITY_FOUND)
if(QT4_FOUND AND (QT_QTMULTIMEDIA_FOUND OR QTMOBILITY_FOUND))
include(${QT_USE_FILE})
else(QT4_FOUND AND (QT_QTMULTIMEDIA_FOUND OR QTMOBILITY_FOUND))
MESSAGE("WARNING : ManyEars GUI will not be compiled because Qt4 not found or obsolete. You need Qt 4.8 or higher.Try using the latest QtSDK from http://qt-project.org")
MESSAGE("DEBUG: QT4_FOUND: ${QT4_FOUND} QT_MULTIMEDIA_FOUND: ${QT_QTMULTIMEDIA_FOUND} QT_MOBILITY_FOUND: ${QTMOBILITY_FOUND}")
SET(MANYEARS_GUI_DISABLED TRUE)
endif(QT4_FOUND AND (QT_QTMULTIMEDIA_FOUND OR QTMOBILITY_FOUND))
ELSE (NOT MANYEARS_GUI_DISABLED)
MESSAGE("ManyEars GUI disabled.")
ENDIF (NOT MANYEARS_GUI_DISABLED)
#Files excluded from package
set(CPACK_SOURCE_IGNORE_FILES
"build"
"bin"
${CPACK_SOURCE_IGNORE_FILES}
".svn"
)
#include files
(...)
IF (UNIX)
#########################################
# Packaging stuff for sources (All UNIX)
#########################################
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.TXT")
SET(CPACK_PACKAGE_NAME "ManyEars")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ManyEars")
SET(CPACK_PACKAGE_VENDOR "Francois Grondin, Dominic Letourneau")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.TXT")
SET(CPACK_PACKAGE_CONTACT "blablablabla")
(...)
ENDIF(UNIX)
(...)
INCLUDE(CPack)
This is confusing me, shouldn't the OpenGL library be installed?
This is confusing me, shouldn't the OpenGL library be installed?
It's not complaining about OpenGL. It's complainting about Qt's OpenGL module QtOpenGL which is a different thing. Most likely your custom build of Qt doesn't include the QtOpenGL module. You've to go back building Qt and take extra care that you enable build of the QtOpenGL module.
After some research I found out that I needed to install some development packages if I was compiling from the source code.
apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev
When configuring the Qt source code I had forgot to specify that I wanted to install the OpenGL module and the Multimedia Kit. I just naturally ran "configure" without any options and hoped for the best.
./configure --help
Specifies that I needed -multimedia and -opengl.
When I executed configure with the correct options the issue was resolved.
./configure -multimedia -opengl
Note that the multimedia kit needs gstreamer installed.

Resources