<?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[MSVC WSL2 Cross-compile returns errors]]></title><description><![CDATA[<p dir="auto">When trying to cross-compile for Linux in Visual Studio, build fails (error and log provided below).<br />
<em>Provide your code where you believe the issue is, it should be compilable:</em><br />
No code, default Qt Widgets project generated by Qt Visual Studio Tools<br />
<em>Provide the minimal amount of code that allows to replicate the issue or work on a solution</em><br />
No code, default Qt Widgets project generated by Qt Visual Studio Tools<br />
<em>Answer these questions:</em><br />
<em>• Which Qt version are you using?</em><br />
Qt version 6.10.1 (both on Windows (msvc_2022_64) and Ubuntu 24.04 WSL2 instance (gcc_64))<br />
<em>• Which version of QtCreator are you using?</em><br />
Not using QtCreator, using Visual Studio 2022 17.14.25 + Qt Visual Studio Tools 3.4.1<br />
<em>• Which platform?</em><br />
Windows+WSL2(Ubuntu 24.04)<br />
<em>• How did you install it?</em><br />
Official online installer</p>
<p dir="auto">Error:</p>
<pre><code class="language-txt">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
</code></pre>
<p dir="auto">Line 119 on qt_vars.targets:</p>
<pre><code class="language-xml">&lt;HostExec
      Command="$(Cmd)" RedirectStdOut="props.txt"
      WorkingDirectory="@(WorkDir-&gt;'%(HostPath)')"
      Outputs="@(QMakeProps)"
      RemoteTarget="$(ResolvedRemoteTarget)"
      RemoteProjectDir="$(_ResolvedRemoteProjectDir)" /&gt;
</code></pre>
<p dir="auto">Build log:</p>
<pre><code class="language-txt">1&gt;------ Build started: Project: QtWidgetsApplication1, Configuration: ReleaseLinux x64 ------
1&gt; Qt/MSBuild: 3.4.1.0
1&gt;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&gt; props.txt', working directory: '/mnt/c/Users/GiyaYet/Documents/Projects/CPP/QtWidgetsApplication1/QtWidgetsApplication1'
1&gt;
1&gt;C:\Users\GiyaYet\AppData\Local\QtMsBuild\qt_vars.targets(119,5): error : Host command failed.
1&gt;Done building project "QtWidgetsApplication1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</code></pre>
<p dir="auto">P.S. I found a topic with a similar error in International section: <a href="https://forum.qt.io/topic/160567/%E5%9C%A8windows%E4%B8%8A%E7%94%A8visual-studio-wsl2%E5%BC%80%E5%8F%91qt%E7%A8%8B%E5%BA%8F%E6%8A%A5%E9%94%99%E9%97%AE%E9%A2%98">here</a> , but it didn't get any replies. I hope that won't be the case for this post.</p>
]]></description><link>https://forum.qt.io/topic/164154/msvc-wsl2-cross-compile-returns-errors</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 13:40:27 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164154.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Jan 2026 08:04:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MSVC WSL2 Cross-compile returns errors on Mon, 26 Jan 2026 19:56:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Something is not clear in your setup, do you have a proper cross-compilation setup ?<br />
This usually means a Qt version for the host OS and a second cross-compiled Qt for your target.<br />
It seems you have two distinct installation. One on your Windows machine and one in your WLS.</p>
]]></description><link>https://forum.qt.io/post/835733</link><guid isPermaLink="true">https://forum.qt.io/post/835733</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 26 Jan 2026 19:56:26 GMT</pubDate></item></channel></rss>