Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MSVC WSL2 Cross-compile returns errors

MSVC WSL2 Cross-compile returns errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 268 Views 1 Watching
  • 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.
  • G Offline
    G Offline
    Giya Yet
    wrote on last edited by Giya Yet
    #1

    When trying to cross-compile for Linux in Visual Studio, build fails (error and log provided below).
    Provide your code where you believe the issue is, it should be compilable:
    No code, default Qt Widgets project generated by Qt Visual Studio Tools
    Provide the minimal amount of code that allows to replicate the issue or work on a solution
    No code, default Qt Widgets project generated by Qt Visual Studio Tools
    Answer these questions:
    • Which Qt version are you using?
    Qt version 6.10.1 (both on Windows (msvc_2022_64) and Ubuntu 24.04 WSL2 instance (gcc_64))
    • Which version of QtCreator are you using?
    Not using QtCreator, using Visual Studio 2022 17.14.25 + Qt Visual Studio Tools 3.4.1
    • Which platform?
    Windows+WSL2(Ubuntu 24.04)
    • How did you install it?
    Official online installer

    Error:

    Error (active)	E2919	command-line error: specified directory via --current_directory option isn't a	QtWidgetsApplication1	C:\Users\GiyaYet\Documents\Projects\CPP\QtWidgetsApplication1\QtWidgetsApplication1\QtWidgetsApplication1.cpp	1			directory:
              /AutoPCHC:\Users\GiyaYet\Documents\Projects\CPP\QtWidgetsApplication1
              \.vs\QtWidgetsApplication1\v17\ipch\AutoPCH\596dd7bd6c7a2361
    Error		Host command failed.	QtWidgetsApplication1	C:\Users\GiyaYet\AppData\Local\QtMsBuild\qt_vars.targets	119
    

    Line 119 on qt_vars.targets:

    <HostExec
          Command="$(Cmd)" RedirectStdOut="props.txt"
          WorkingDirectory="@(WorkDir->'%(HostPath)')"
          Outputs="@(QMakeProps)"
          RemoteTarget="$(ResolvedRemoteTarget)"
          RemoteProjectDir="$(_ResolvedRemoteProjectDir)" />
    

    Build log:

    1>------ Build started: Project: QtWidgetsApplication1, Configuration: ReleaseLinux x64 ------
    1> Qt/MSBuild: 3.4.1.0
    1>Invoking 'mkdir -p $(dirname /mnt/c/Users/GiyaYet/Documents/Projects/CPP/QtWidgetsApplication1/QtWidgetsApplication1/obj/x64/ReleaseLinux/qt/qmake/props.txt); mkdir -p /mnt/c/Users/GiyaYet/Documents/Projects/CPP/QtWidgetsApplication1/QtWidgetsApplication1/obj/x64/ReleaseLinux/qt/qmake; cd /mnt/c/Users/GiyaYet/Documents/Projects/CPP/QtWidgetsApplication1/QtWidgetsApplication1/obj/x64/ReleaseLinux/qt/qmake; ("//wsl.localhost/Ubuntu-24.04/home/giyayet/Qt/6.10.1/gcc_64/bin/qmake" -query) 1> props.txt', working directory: '/mnt/c/Users/GiyaYet/Documents/Projects/CPP/QtWidgetsApplication1/QtWidgetsApplication1'
    1>
    1>C:\Users\GiyaYet\AppData\Local\QtMsBuild\qt_vars.targets(119,5): error : Host command failed.
    1>Done building project "QtWidgetsApplication1.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    

    P.S. I found a topic with a similar error in International section: here , but it didn't get any replies. I hope that won't be the case for this post.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Something is not clear in your setup, do you have a proper cross-compilation setup ?
      This usually means a Qt version for the host OS and a second cross-compiled Qt for your target.
      It seems you have two distinct installation. One on your Windows machine and one in your WLS.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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