Building Qt 6.6.0 for i686/x86 (Win10/Win11, winlibs/mingw32) linker error
-
I am trying to build Qt for 32-bit Windows 7/8/10, so I can build 32-bit version of my application after that.
I had to add "include <cstdint>" to FBX source code, because of "std::unit32_t not included" errors.
Now I stuck on linker error, that tells me:C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/13.2.0/../../../../i686-w64-mingw32/bin/ld.exe: qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/sandboxing.cpp.obj:sandboxing.cpp:(.text$_ZN12AppContainerC1ERK7QString[__ZN12AppContainerC1ERK7QString]+0x50): undefined reference to `_imp__CreateAppContainerProfile@24' C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/13.2.0/../../../../i686-w64-mingw32/bin/ld.exe: qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/sandboxing.cpp.obj:sandboxing.cpp:(.text$_ZN12AppContainerC1ERK7QString[__ZN12AppContainerC1ERK7QString]+0x3dd): undefined reference to `_imp__DeriveAppContainerSidFromAppContainerName@8'"
Source Code:
https://download.qt.io/official_releases/qt/6.6/6.6.0/single/qt-everywhere-src-6.6.0.zip.torrentBuild environment:
OS: Windows 10 (32-bit) and Windows 11 (64-bit)I understand that I need to add some library to uhh ninja.build(?) file, to linker phase, can you help me please.
-
Commands that I use:
SET _QTROOT=C:\msys64\home\Demensdeum\Sources\3rdParty\Qt6\qt-everywhere-src-6.6.0\Src SET _MINGW32ROOT=C:\Users\Demensdeum\Documents\Sources\3rdParty\winlibs-ming32\bin\ SET _MAKEROOT=C:\Users\Demensdeum\Documents\Sources\3rdParty\make\bin\ SET PATH=%_QTROOT%;%_MINGW32ROOT%;%_MAKEROOT%;%PATH% SET _QTROOT= SET _MINGW32ROOT= SET _MAKEROOT= rmdir build mkdir build cd build C:\msys64\home\Demensdeum\Sources\3rdParty\Qt6\qt-everywhere-src-6.6.0\configure.bat cmake --build . cmake --install .
-
@DemensDeum
Here is full linker error:C:\Users\Demensdeum\Documents\Sources\3rdParty\qt\build>cmake --build . --parallel [1/2992] Linking CXX executable qtbase\bin\testcon.exe FAILED: qtbase/bin/testcon.exe cmd.exe /C "cd . && C:\Users\Demensdeum\Documents\Sources\3rdParty\winlibs-ming32\bin\c++.exe -DNDEBUG -O2 -mwindows qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/testcon_autogen/mocs_compilation.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/ambientproperties.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/changeproperties.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/controlinfo.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/docuwindow.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/invokemethod.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/main.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/mainwindow.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/sandboxing.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/.rcc/qrc_testcon.cpp.obj qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/testcon_resource.rc.obj -o qtbase\bin\testcon.exe -Wl,--out-implib,qtactiveqt\tools\testcon\libtestcon.dll.a -Wl,--major-image-version,0,--minor-image-version,0 qtbase/lib/libQt6AxContainer.a qtbase/lib/libQt6AxServer.a qtbase/lib/libQt6PrintSupport.a qtbase/lib/libQt6AxContainer.a qtbase/lib/libQt6AxBase.a -ladvapi32 -lgdi32 -lole32 -loleaut32 -luser32 -luuid qtbase/lib/libQt6Widgets.a qtbase/lib/libQt6Gui.a -ld3d11 -ldxgi -ldxguid -ld3d12 qtbase/lib/libQt6Core.a -lmpr -luserenv -lmingw32 qtbase/lib/libQt6EntryPoint.a -lshell32 -lcomdlg32 -lwinspool -lpthread -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ." C:/Users/Demensdeum/Documents/Sources/3rdParty/winlibs-ming32/bin/../lib/gcc/i686-w64-mingw32/13.2.0/../../../../i686-w64-mingw32/bin/ld.exe: qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/sandboxing.cpp.obj:sandboxing.cpp:(.text$_ZN12AppContainerC1ERK7QString[__ZN12AppContainerC1ERK7QString]+0x50): undefined reference to `_imp__CreateAppContainerProfile@24' C:/Users/Demensdeum/Documents/Sources/3rdParty/winlibs-ming32/bin/../lib/gcc/i686-w64-mingw32/13.2.0/../../../../i686-w64-mingw32/bin/ld.exe: qtactiveqt/tools/testcon/CMakeFiles/testcon.dir/sandboxing.cpp.obj:sandboxing.cpp:(.text$_ZN12AppContainerC1ERK7QString[__ZN12AppContainerC1ERK7QString]+0x3dd): undefined reference to `_imp__DeriveAppContainerSidFromAppContainerName@8' collect2.exe: error: ld returned 1 exit status [18/2992] Building CXX object qtchart...r/splinechart/splinechartitem.cpp.ob ninja: build stopped: subcommand failed.
Something related to userenv.dll I guess?
-
I think I did it. Had to download and add userenv.lib to build.ninja at line with that failed to compile (-LPathToDirectory -luserenv).
Also had to break PhysX source code (just commented guards code)
[Solved] -
-
@DemensDeum
where you put the file, where you download and how to you ninja -
Same problem with 6.7.1
- Get userenv lib here https://github.com/ojdkbuild/tools_toolchain_sdk10_1607/blob/master/Lib/10.0.14393.0/um/x86/UserEnv.Lib , download it somwhere, for example to
d:\temp\lib
- Go to your Qt build directory, find file
build.ninja
- Edit it with text editor. Find text
Link the executable qtbase\bin\testcon.exe
- Go to the line that starts with
LINK_LIBRARIES
. Go to its end. - Write at the end of that line
-LD:\temp\lib\ -luserenv
- Save and repeat build.
- Get userenv lib here https://github.com/ojdkbuild/tools_toolchain_sdk10_1607/blob/master/Lib/10.0.14393.0/um/x86/UserEnv.Lib , download it somwhere, for example to