Build error on qt 6.8
-
wrote on 4 Apr 2025, 06:01 last edited by Qt embedded developer 4 Apr 2025, 07:55
when i run qt quick simple example using qt 6.8 i am getting below error:
":-1: error: CMakeFiles/appRectangle.dir/main.cpp.o: undefined reference to symbol '_ZdlPvm@@CXXABI_1.3.9'
:-1: error: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
:-1: error: collect2: error: ld returned 1 exit status
:-1: error: [CMakeFiles/appRectangle.dir/build.make:266: appRectangle] Error 1"Solution: adding stdc++ in below code
target_link_libraries(appRectangle PRIVATE Qt6::Quick stdc++ )
why compile out put generate this many lines :
CCACHE_NODISABLE=true DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/ DESKTOP_SESSION=gnome DISPLAY=:0 EDITOR=/usr/bin/nano EMSDK=/home/ma/WebAssembly/emsdk EMSDK_NODE=/home/ma/WebAssembly/emsdk/node/16.20.0_64bit/bin/node EM_CACHE=/home/ma/WebAssembly/emsdk/upstream/emscripten/cache EM_CONFIG=/home/ma/WebAssembly/emsdk/.emscripten GDMSESSION=gnome GDM_LANG=en_US.UTF-8 GIO_LAUNCHED_DESKTOP_FILE=/home/ma/.local/share/applications/org.qt-project.qtcreator.desktop GIO_LAUNCHED_DESKTOP_FILE_PID=4957 GITHUB_TOKEN=ghp_YDxEGA24MePZ5 GJS_DEBUG_OUTPUT=stderr GJS_DEBUG_TOPICS=JS ERROR;JS LOG GNOME_SETUP_DISPLAY=:1 HISTCONTROL=ignoredups HISTSIZE=1000 HOME=/home/ma HOSTNAME=fedora INVOCATION_ID=ea7079b8c6 JFROG_API_KEY=AKCpM JFROG_USERNAME=ma JOURNAL_STREAM=8:16781 LANG=en_US.UTF-8 LD_LIBRARY_PATH=/home/ma/Qt6.8.3/6.8.3/gcc_64/lib:/usr/lib::/usr/local/lib LESSOPEN=||/usr/bin/lesspipe.sh %s LOCAL_DEV_MACHINE=true LOGNAME=ma MAIL=/var/spool/mail/ma MANAGERPID=2085 MOZ_GMP_PATH=/usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed PATH=/home/ma/WebAssembly/emsdk:/home/ma/WebAssembly/emsdk/upstream/emscripten:/home/ma/WebAssembly/emsdk/node/16.20.0_64bit/bin:/home/ma/.local/bin:/home/ma/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin PWD=/home/ma QTDIR=/home/ma/Qt6.8.3/6.8.3/gcc_64 QT_IM_MODULE=ibus QT_QPA_PLATFORM=xcb SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2268,unix/unix:/tmp/.ICE-unix/2268 SHELL=/bin/bash SHLVL=0 SSH_AUTH_SOCK=/run/user/1000/keyring/ssh SYSTEMD_EXEC_PID=2329 USER=ma USERNAME=ma WAYLAND_DISPLAY=wayland-0 XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.C1SZ32 XDG_CURRENT_DESKTOP=GNOME XDG_DATA_DIRS=/home/ma/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop XDG_MENU_PREFIX=gnome- XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_CLASS=user XDG_SESSION_DESKTOP=gnome XDG_SESSION_TYPE=wayland XMODIFIERS=@im=ibus _QTC_LD_LIBRARY_PATH=/home/ma/Qt6.8.3/6.8.3/gcc_64/lib
why in older version it works fine without adding it? what is correct solution for it on linux?
question 2: why cmake modules in qt creator get invisible in latest version qt 6.8?
-
when i run qt quick simple example using qt 6.8 i am getting below error:
":-1: error: CMakeFiles/appRectangle.dir/main.cpp.o: undefined reference to symbol '_ZdlPvm@@CXXABI_1.3.9'
:-1: error: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
:-1: error: collect2: error: ld returned 1 exit status
:-1: error: [CMakeFiles/appRectangle.dir/build.make:266: appRectangle] Error 1"Solution: adding stdc++ in below code
target_link_libraries(appRectangle PRIVATE Qt6::Quick stdc++ )
why compile out put generate this many lines :
CCACHE_NODISABLE=true DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/ DESKTOP_SESSION=gnome DISPLAY=:0 EDITOR=/usr/bin/nano EMSDK=/home/ma/WebAssembly/emsdk EMSDK_NODE=/home/ma/WebAssembly/emsdk/node/16.20.0_64bit/bin/node EM_CACHE=/home/ma/WebAssembly/emsdk/upstream/emscripten/cache EM_CONFIG=/home/ma/WebAssembly/emsdk/.emscripten GDMSESSION=gnome GDM_LANG=en_US.UTF-8 GIO_LAUNCHED_DESKTOP_FILE=/home/ma/.local/share/applications/org.qt-project.qtcreator.desktop GIO_LAUNCHED_DESKTOP_FILE_PID=4957 GITHUB_TOKEN=ghp_YDxEGA24MePZ5 GJS_DEBUG_OUTPUT=stderr GJS_DEBUG_TOPICS=JS ERROR;JS LOG GNOME_SETUP_DISPLAY=:1 HISTCONTROL=ignoredups HISTSIZE=1000 HOME=/home/ma HOSTNAME=fedora INVOCATION_ID=ea7079b8c6 JFROG_API_KEY=AKCpM JFROG_USERNAME=ma JOURNAL_STREAM=8:16781 LANG=en_US.UTF-8 LD_LIBRARY_PATH=/home/ma/Qt6.8.3/6.8.3/gcc_64/lib:/usr/lib::/usr/local/lib LESSOPEN=||/usr/bin/lesspipe.sh %s LOCAL_DEV_MACHINE=true LOGNAME=ma MAIL=/var/spool/mail/ma MANAGERPID=2085 MOZ_GMP_PATH=/usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed PATH=/home/ma/WebAssembly/emsdk:/home/ma/WebAssembly/emsdk/upstream/emscripten:/home/ma/WebAssembly/emsdk/node/16.20.0_64bit/bin:/home/ma/.local/bin:/home/ma/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin PWD=/home/ma QTDIR=/home/ma/Qt6.8.3/6.8.3/gcc_64 QT_IM_MODULE=ibus QT_QPA_PLATFORM=xcb SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2268,unix/unix:/tmp/.ICE-unix/2268 SHELL=/bin/bash SHLVL=0 SSH_AUTH_SOCK=/run/user/1000/keyring/ssh SYSTEMD_EXEC_PID=2329 USER=ma USERNAME=ma WAYLAND_DISPLAY=wayland-0 XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.C1SZ32 XDG_CURRENT_DESKTOP=GNOME XDG_DATA_DIRS=/home/ma/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop XDG_MENU_PREFIX=gnome- XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_CLASS=user XDG_SESSION_DESKTOP=gnome XDG_SESSION_TYPE=wayland XMODIFIERS=@im=ibus _QTC_LD_LIBRARY_PATH=/home/ma/Qt6.8.3/6.8.3/gcc_64/lib
why in older version it works fine without adding it? what is correct solution for it on linux?
question 2: why cmake modules in qt creator get invisible in latest version qt 6.8?
I am a bit confused about what your question is.
why compile out put generate this many lines :
That's not a compile output.
why in older version it works fine without adding it?
Which older version? What works fine without adding what?
what is correct solution for it on linux?
The correct solution for what?
question 2: why cmake modules in qt creator get invisible in latest version qt 6.8?
I have already counted three questions before "question 2".
Never mind, CMake modules don't get invisible in 6.8.If the actual question is:
Where does the undefined reference to symbol ... come from?
=> Probably the compiler isn't compatible with C++ ABI version 1.3.9.
=> But that's just a guess, since we don't know what you are compiling, which compiler you use on which operating system. -
I am a bit confused about what your question is.
why compile out put generate this many lines :
That's not a compile output.
why in older version it works fine without adding it?
Which older version? What works fine without adding what?
what is correct solution for it on linux?
The correct solution for what?
question 2: why cmake modules in qt creator get invisible in latest version qt 6.8?
I have already counted three questions before "question 2".
Never mind, CMake modules don't get invisible in 6.8.If the actual question is:
Where does the undefined reference to symbol ... come from?
=> Probably the compiler isn't compatible with C++ ABI version 1.3.9.
=> But that's just a guess, since we don't know what you are compiling, which compiler you use on which operating system.wrote 21 days ago last edited by Qt embedded developer@Axel-Spoerl 
what is this ? why it get shown there?
answer of Which older version? What works fine without adding what?:
older version: qt 5.15.2. my below source code works fine with this version. but for qt 6.8.2 version i need to explicitly need to add stdc++ as shown below :
target_link_libraries(appqmlbasic
PRIVATE Qt6::Quick stdc++
)import QtQuick Window { width: 640 height: 480 visible: true title: qsTr("Hello World") }
why i need to add stdc++ that way ?what is right solution for avoiding adding explicitly stdc++ in target link library ?
i am using fedor, so compiler is gcc.
if your answer is : compiler isn't compatible with C++ ABI version 1.3.9
then what is solution to make it compatible on fedora for qt 6.8.2?
-
@Qt-embedded-developer said in Build error on qt 6.8:
what is this ? why it get shown there?
It's the compile output. It gets shown here, because you have selected tab No. 4 "Compile Output".
You don't have to explicitly link to
stdc++
.i am using fedor, so compiler is gcc.
What does
gcc --version
say?
Here is some general documentation about compiling Qt sources, which includes a section about required GCC versions.
Here is a list of libraries /headers needed to compile Qt on Linux.Fedora isn't officially supported. That doesn't mean you can't build or use it, but there are no official instructions how to break down the list of required libraries / headers to Fedora packages.
There is an old wiki page related to Qt5, which has some instructions for Fedora 30. You could use that as a starting point. -
@Qt-embedded-developer said in Build error on qt 6.8:
what is this ? why it get shown there?
It's the compile output. It gets shown here, because you have selected tab No. 4 "Compile Output".
You don't have to explicitly link to
stdc++
.i am using fedor, so compiler is gcc.
What does
gcc --version
say?
Here is some general documentation about compiling Qt sources, which includes a section about required GCC versions.
Here is a list of libraries /headers needed to compile Qt on Linux.Fedora isn't officially supported. That doesn't mean you can't build or use it, but there are no official instructions how to break down the list of required libraries / headers to Fedora packages.
There is an old wiki page related to Qt5, which has some instructions for Fedora 30. You could use that as a starting point.wrote 19 days ago last edited by@Axel-Spoerl said in Build error on qt 6.8:
gcc --version
it say:
gcc (GCC) 13.2.1 20240316 (Red Hat 13.2.1-7)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -