<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux]]></title><description><![CDATA[<p dir="auto">I'm new to Qt. I selected Qt 6 in my Desktop kit. When I use ldd on the resulting binary I get<br />
libQt5Widgets.so.5 =&gt; /usr/lib64/libQt5Widgets.so.5 (0x00007f4decab7000)<br />
libQt5Gui.so.5 =&gt; /usr/lib64/libQt5Gui.so.5 (0x00007f4dec486000)<br />
libQt5Core.so.5 =&gt; /usr/lib64/libQt5Core.so.5 (0x00007f4debf27000)<br />
among other shared objects. The binary is linked to Qt 5 instead of Qt 6. My application is a normal Qt Widgets Application. There is no difference between Debug and Release in this regard. When I select Qt 5 nothing changes.</p>
<p dir="auto">I assume this is not the normal behavior. How can I get to the root cause of this? Where do I start to dig?</p>
]]></description><link>https://forum.qt.io/topic/164469/trying-to-build-a-qt-6-application-but-getting-a-qt-5-application-qt-creator-19-on-gentoo-linux</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 22:51:03 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164469.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Mar 2026 14:18:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Wed, 25 Mar 2026 16:46:59 GMT]]></title><description><![CDATA[<p dir="auto">I have the development packages for Qt5 and Qt6. As you mentioned it works when I remove Qt5 from the following statement in CMakeLists.txt.</p>
<pre><code>#find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
#find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets)

</code></pre>
<p dir="auto">The first and third line result in a Qt5 build. The second line results in a Qt6 build. The "Qt version" field in my kit seems to have no influence. I set the value to "None".</p>
<p dir="auto">The issue is resolved. However in a weird way.</p>
]]></description><link>https://forum.qt.io/post/837330</link><guid isPermaLink="true">https://forum.qt.io/post/837330</guid><dc:creator><![CDATA[mgoppelt]]></dc:creator><pubDate>Wed, 25 Mar 2026 16:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Wed, 25 Mar 2026 16:29:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mgoppelt">@<bdi>mgoppelt</bdi></a> And did you install the Qt6 development packages? Remove Qt5 from the CMakeLists.txt and start over with a clean build dir after you made sure the dev packages for Qt6 are installed (and even better - the dev packages for Qt5 are uninstalled).</p>
]]></description><link>https://forum.qt.io/post/837329</link><guid isPermaLink="true">https://forum.qt.io/post/837329</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Wed, 25 Mar 2026 16:29:54 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Wed, 25 Mar 2026 15:42:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mgoppelt">@<bdi>mgoppelt</bdi></a> said in <a href="/post/837326">Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux</a>:</p>
<blockquote>
<p dir="auto">Is there a way to insert a code segment without automatic coloring?</p>
</blockquote>
<p dir="auto">```text<br />
your log<br />
```</p>
]]></description><link>https://forum.qt.io/post/837327</link><guid isPermaLink="true">https://forum.qt.io/post/837327</guid><dc:creator><![CDATA[GrecKo]]></dc:creator><pubDate>Wed, 25 Mar 2026 15:42:52 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Wed, 25 Mar 2026 14:52:09 GMT]]></title><description><![CDATA[<p dir="auto">Is there a way to insert a code segment without automatic coloring?</p>
]]></description><link>https://forum.qt.io/post/837326</link><guid isPermaLink="true">https://forum.qt.io/post/837326</guid><dc:creator><![CDATA[mgoppelt]]></dc:creator><pubDate>Wed, 25 Mar 2026 14:52:09 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Wed, 25 Mar 2026 14:36:19 GMT]]></title><description><![CDATA[<p dir="auto">I could only get a Qt 5 build using cmake and ninja.</p>
<p dir="auto">First cmake:</p>
<pre><code>markus@ryzen ~/Qt/Projekt_Muehle $ cmake -G Ninja -S Qt/ -B Qt/build/test_build/
-- The CXX compiler identification is GNU 15.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/markus/Qt/Projekt_Muehle/Qt/build/test_build
</code></pre>
<p dir="auto">Then ninja:</p>
<pre><code>markus@ryzen ~/Qt/Projekt_Muehle/Qt/build/test_build $ ls
build.ninja  CMakeCache.txt  CMakeFiles  cmake_install.cmake
markus@ryzen ~/Qt/Projekt_Muehle/Qt/build/test_build $ ninja
[13/13] Linking CXX executable Projekt_Muehle
</code></pre>
<p dir="auto">The files build.ninja and CMakeCache.txt only contain references to Qt 5:</p>
<pre><code>markus@ryzen ~/Qt/Projekt_Muehle/Qt/build/test_build $ grep LINK_LIBRARIES build.ninja
  LINK_LIBRARIES = /usr/lib64/libQt5Widgets.so.5.15.18  /usr/lib64/libQt5Gui.so.5.15.18  /usr/lib64/libQt5Core.so.5.15.18
markus@ryzen ~/Qt/Projekt_Muehle/Qt/build/test_build $ grep -e Qt5Widgets -e Qt5Gui -e Qt5Core CMakeCache.txt
//The directory containing a CMake configuration file for Qt5Core.
Qt5Core_DIR:PATH=/usr/lib64/cmake/Qt5Core
//The directory containing a CMake configuration file for Qt5Gui.
Qt5Gui_DIR:PATH=/usr/lib64/cmake/Qt5Gui
//The directory containing a CMake configuration file for Qt5Widgets.
Qt5Widgets_DIR:PATH=/usr/lib64/cmake/Qt5Widgets
markus@ryzen ~/Qt/Projekt_Muehle/Qt/build/test_build $ grep -e Qt6Widgets -e Qt6Gui -e Qt6Core CMakeCache.txt
</code></pre>
<p dir="auto">These two files were generated by Qt Creator prior to me using the command line:</p>
<pre><code>markus@ryzen ~/Qt/Projekt_Muehle/Qt $ ls CMakeLists.txt .qtcreator/CMakeLists.txt.user 
CMakeLists.txt  .qtcreator/CMakeLists.txt.user
</code></pre>
<p dir="auto">I don't think the second file is relevant for the command line cmake.</p>
]]></description><link>https://forum.qt.io/post/837325</link><guid isPermaLink="true">https://forum.qt.io/post/837325</guid><dc:creator><![CDATA[mgoppelt]]></dc:creator><pubDate>Wed, 25 Mar 2026 14:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Tue, 24 Mar 2026 20:19:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Just to clear things out, can you properly build that project on the command line for each version of Qt ?</p>
]]></description><link>https://forum.qt.io/post/837307</link><guid isPermaLink="true">https://forum.qt.io/post/837307</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 24 Mar 2026 20:19:29 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Tue, 24 Mar 2026 19:12:43 GMT]]></title><description><![CDATA[<p dir="auto">Here comes CMakeLists.txt:</p>
<pre><code>cmake_minimum_required(VERSION 3.16)

project(Projekt_Muehle VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

#set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(${PROJECT_SOURCE_DIR})

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

set(PROJECT_SOURCES
        main.cpp
        mainwindow.cpp
        mainwindow.h
        mainwindow.ui
)

if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
    qt_add_executable(Projekt_Muehle
        MANUAL_FINALIZATION
        ${PROJECT_SOURCES}
        add_args.h
        add_args.cpp
        mill_view.h mill_view.cpp
        mill_model.h mill_model.cpp
        mill_controller.h mill_controller.cpp
        player.h player.cpp
        board.h board.cpp board.ui
        token.h token.cpp token.ui
        board_label.h board_label.cpp board_label.ui
        res.qrc
    )
# Define target properties for Android with Qt 6 as:
#    set_property(TARGET Projekt_Muehle APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
#                 ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
    if(ANDROID)
        add_library(Projekt_Muehle SHARED
            ${PROJECT_SOURCES}
        )
# Define properties for Android with Qt 5 after find_package() calls as:
#    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
    else()
        add_executable(Projekt_Muehle
            ${PROJECT_SOURCES}
            add_args.cpp add_args.h
            board.cpp board.h board.ui
            board_label.cpp board_label.h board_label.ui
            mill_controller.cpp mill_controller.h
            mill_model.cpp mill_model.h
            mill_view.cpp mill_view.h
            player.cpp player.h
            token.cpp token.h token.ui
        )
    endif()
endif()

target_link_libraries(Projekt_Muehle PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
if(${QT_VERSION} VERSION_LESS 6.1.0)
  set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.Projekt_Muehle)
endif()
set_target_properties(Projekt_Muehle PROPERTIES
    ${BUNDLE_ID_OPTION}
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

include(GNUInstallDirs)
install(TARGETS Projekt_Muehle
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

if(QT_VERSION_MAJOR EQUAL 6)
    qt_finalize_executable(Projekt_Muehle)
endif()
</code></pre>
]]></description><link>https://forum.qt.io/post/837306</link><guid isPermaLink="true">https://forum.qt.io/post/837306</guid><dc:creator><![CDATA[mgoppelt]]></dc:creator><pubDate>Tue, 24 Mar 2026 19:12:43 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Tue, 24 Mar 2026 16:46:06 GMT]]></title><description><![CDATA[<p dir="auto">CMakeLists.txt doesn't restrict the build to Qt 5 or Qt 6. There appear two variables regarding the version<br />
${QT_VERSION_MAJOR}<br />
${QT_VERSION}<br />
. I will either attach CMakeLists.txt or dump it into a new reply.</p>
]]></description><link>https://forum.qt.io/post/837303</link><guid isPermaLink="true">https://forum.qt.io/post/837303</guid><dc:creator><![CDATA[mgoppelt]]></dc:creator><pubDate>Tue, 24 Mar 2026 16:46:06 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Mon, 23 Mar 2026 19:11:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mgoppelt">@<bdi>mgoppelt</bdi></a><br />
OK, so for whatever reason even though you have picked a Qt6 kit it's compiling/linking as Qt5.  Someone else will doubtless know more.  Does the <strong>CMakeLists.txt</strong> for the project show anything about setting for either Qt6 or Qt5?</p>
]]></description><link>https://forum.qt.io/post/837270</link><guid isPermaLink="true">https://forum.qt.io/post/837270</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 23 Mar 2026 19:11:01 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Mon, 23 Mar 2026 19:00:07 GMT]]></title><description><![CDATA[<p dir="auto">Good point. Qt6 is also installed. The shared objects<br />
/usr/lib64/libQt6Core.so.6<br />
/usr/lib64/libQt6Gui.so.6<br />
/usr/lib64/libQt6Widgets.so.6<br />
are available. I'm quite sure that Gentoo builds Qt (both 5 and 6) from the sources.</p>
]]></description><link>https://forum.qt.io/post/837269</link><guid isPermaLink="true">https://forum.qt.io/post/837269</guid><dc:creator><![CDATA[mgoppelt]]></dc:creator><pubDate>Mon, 23 Mar 2026 19:00:07 GMT</pubDate></item><item><title><![CDATA[Reply to Trying to build a Qt 6 application but getting a Qt 5 application; Qt Creator 19 on Gentoo Linux on Mon, 23 Mar 2026 14:34:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mgoppelt">@<bdi>mgoppelt</bdi></a><br />
Your paths show a Qt5 installed in <code>/usr/lib64</code>, which is presumably supplied by your Linux OS.  Quite likely it does not supply a Qt6?</p>
<p dir="auto">So did you fetch and install (a pre-built) Qt6 yourself?  Is your kit and build commands not picking that up and compiling/linking against the system's Qt5?</p>
]]></description><link>https://forum.qt.io/post/837265</link><guid isPermaLink="true">https://forum.qt.io/post/837265</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 23 Mar 2026 14:34:40 GMT</pubDate></item></channel></rss>