Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building Qt 6.6.0 for i686/x86 (Win10/Win11, winlibs/mingw32) linker error

Building Qt 6.6.0 for i686/x86 (Win10/Win11, winlibs/mingw32) linker error

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DemensDeum
    wrote on last edited by DemensDeum
    #1

    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.torrent

    Build environment:
    OS: Windows 10 (32-bit) and Windows 11 (64-bit)

    Toolchain:
    https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0mcf-16.0.6-11.0.1-ucrt-r2/winlibs-i686-mcf-dwarf-gcc-13.2.0-mingw-w64ucrt-11.0.1-r2.7z

    I understand that I need to add some library to uhh ninja.build(?) file, to linker phase, can you help me please.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DemensDeum
      wrote on last edited by DemensDeum
      #2

      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 .
      
      D 1 Reply Last reply
      0
      • D DemensDeum

        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 .
        
        D Offline
        D Offline
        DemensDeum
        wrote on last edited by
        #3

        @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?

        D 1 Reply Last reply
        0
        • D DemensDeum

          @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?

          D Offline
          D Offline
          DemensDeum
          wrote on last edited by DemensDeum
          #4

          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]

          J 1 Reply Last reply
          0
          • D DemensDeum has marked this topic as solved on
          • D DemensDeum

            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]

            J Offline
            J Offline
            jchaviano
            wrote on last edited by
            #5

            @DemensDeum
            where you put the file, where you download and how to you ninja

            1 Reply Last reply
            0
            • V Offline
              V Offline
              veloy
              wrote on last edited by
              #6

              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.
              1 Reply Last reply
              0
              • V Offline
                V Offline
                veloy
                wrote on last edited by veloy
                #7

                I found better solution. If you have mingw32, create userenv.lib yourself

                mkdir c:\temp\lib
                cd c:\temp\lib
                c:\mingw32\bin\gendef.exe c:\Windows\SysWOW64\userenv.dll
                c:\mingw32\bin\dlltool.exe -d userenv.def -l userenv.lib
                
                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved