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. Cross-Compiling Qt Application with WSL and Visual Studio 2019 results in ERROR running qmake

Cross-Compiling Qt Application with WSL and Visual Studio 2019 results in ERROR running qmake

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
cross compilelinuxqt5.14
1 Posts 1 Posters 640 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
    deranda
    wrote on 19 Feb 2024, 13:50 last edited by
    #1

    Hi everyone,
    since a while I am struggling with getting the cross-compilation running in Visual Studio 2019.
    I want to cross-compile Qt applications on my windwos host system (with Qt5.14.2 being installed) for Linux systems using the windows integrated WSL2.
    On the internet, some guides can be found e.g.: Qt Blog - Cross-Compiling embedded QtQuickApplication in Visual Studio.
    So I have followed the steps, which I will briefly describe now:
    -> modifying the VS2019 installtion and add "Linux development with C++" and "Desktop development with C++" was already installed.
    -> setup WSL2 with Ubuntu 22.04
    -> install all the required tools and compiler with:

    sudo apt install -y build-essential qtcreator qtbase5-dev qt5-qmake
    

    -> running Qt VS Tools and add Qt installation with Host "Linux WSL", compiler set to "g++" and path:

    /usr/lib/x86_64-linux-gnu/qt5
    

    -> created a plain QtConsoleApplication project and added the Qt_WSL version in addtition to the Qt WIndows version for both, release and debug
    -> VS2019 directly shows, that it canno open source file "QtCore/QCoreApplication". So it seems like, there is some linking missing. When trying to build the application to get some more information, the following error with qmake appears (I have manually replaced the username by "User"):

    >QtConsoleApplication1.vcxproj : error : ERROR running qmake
    >QtConsoleApplication1.vcxproj : error : qmake: (/usr/lib/x86_64-linux-gnu/qt5/bin/qmake)
    >QtConsoleApplication1.vcxproj : error : qmake: $PWD=C:\Users\"User"\Documents\QtConsoleApplication1\obj\x64\Debug_WSL\qmake\temp
    >QtConsoleApplication1.vcxproj : error : qmake: WARNING: Unable to generate output for: /mnt/c/Users/"User"/Documents/QtConsoleApplication1/obj/x64/Debug_WSL/qmake/temp/Makefile [TEMPLATE vcapp]
    >QtConsoleApplication1.vcxproj : error : qmake: QIODevice::write: device not open
    >QtConsoleApplication1.vcxproj : error : qmake: Error creating .vcxproj file
    

    Then I have also tried to create a QtConsoleApplication only using the Qt_WSL version in the Qt Console Application Wizard, but I receive the following error from VS2019:
    1.PNG
    To me, both errors indicate, that there is something wrong with the linking, e.g. that the second error tries to resolve a path that mixes the windows and linux path structur "C:\usr\lib...."
    But I dont know, how to fix this problem and I appreciate any kind of help :)

    1 Reply Last reply
    0

    1/1

    19 Feb 2024, 13:50

    • Login

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