Project error cannot run compiler cl output

I am new to Qt and this is my first post. I am using Qt 5.12 on two different computers ... both on MSVC (MSVisual Stuido 2017 ) identical version on both the machines but at different locations computer 1. standard location c:program files .... etc Qt...

This topic has been deleted. Only users with topic management privileges can see it.

  • I am new to Qt and this is my first post.

    I am using Qt 5.12 on two different computers … both on MSVC (MSVisual Stuido 2017 ) identical version on both the machines but at different locations

    computer 1. standard location c:program files …. etc
    Qt 5.12 is installed on e drive ……….that is a usb drive

    computer 2. it is D: ….. etc
    Qt is also installed on D:Qt directory

    On computer 1, I have absolutely no problem.
    QtCreator started in next minute and I could compile and run textedit project in 10 minutes.

    On computer 2, I cannot use Qt creator at all
    It did not set the kit itself like it did on computer 1
    It told me to set up kits ……so I put the paths for cl.exe and cmake.exe (after reading on google and Qt forums)

    Still when I try to compile, it throws following error:

    This is what I read from General Messages tab :

    Running Windows Runtime device detection.
    No winrtrunner.exe found.
    Project ERROR: Cannot run compiler ‘cl’. Output:

    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file D:QtExamplesQt-5.12.0widgetsrichtexttextedittextedit.pro. Giving up.
    Project ERROR: Cannot run compiler ‘cl’. Output:

    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file D:QtExamplesQt-5.12.0widgetsrichtexttextedittextedit.pro. Giving up.

    Please help or point me to where I can get proper direction.
    Thanks

  • Hi and welcome to devnet,

    Did you install Visual Studio 2017 also on both machines ?

  • @SGaist Yes sir. I have installed Visual Studio 2017 on both these machines and am successfully able to use both of those to build and create other Windows executables and libraries.

    Thanks

  • @mvelanka

    Running Windows Runtime device detection.
    No winrtrunner.exe found

    Do you want to create classic Windows programs or UWP apps? Looks like the Qt version here is for UWP, not sure that was your intention.

    Regards

  • @aha_1980 I want to create Windows Programs with widgets like rich text editor. ……..I did exactly same install for Qt on both these machines (only difference is the locations of VS 2017 and Qt)

  • @mvelanka can you show the installed Qt versions in Options > Kits?

  • @mvelanka said in Qt Creator says «Project ERROR: Cannot run compiler ‘cl’. Output:»:

    No winrtrunner.exe found

    seems like you did not install the windows software development kit ? It’s needed for the debugger.
    AFAIC that one comes seperately from Visual Studio

  • @aha_1980,
    Qt Versions are shown as follows:
    0_1544629164272_QtVersionsInKits.png

    HTH
    Thanks

  • You should also compare the Compilers tab and the Kits tab.

  • @J.Hilk

    I believe I have two kits installed see this

    0_1544630035065_WindowsSDKs.png

    Hope, I am in the right direction.
    Thanks

  • @SGaist ,

    Here is the screen shot showing compilers
    0_1544630168559_CompilersInKits.png

    In that «Custom» is the one I created/added by entering the values for Compiler Path and Make Path

    HTH
    Thanks

  • @mvelanka

    it doesn’t work like this. MSVC compilers must be autodetected to be useable. Do you have the vcvars*.bat in the VS folder?

  • @aha_1980 ,
    Yes I do have them
    0_1544639574536_vcvars.png

    How to use these batch files?
    Please let me know
    Thanks

  • @mvelanka QtCreator uns this batch file to setup the build environment. I’m not sure how it finds this file, but it seems your non-standard installation confuses it.

    Any reason to not install MSVC on drive C? ( I guess Qt is fine on D, but for the compiler I’m unsure)

  • @aha_1980 ,

    The reason why VS and kits is in non standard location is because it is used in that way for our other projects.
    We have many projects on windows.
    This is the first time I am trying Qt

  • @mvelanka ,
    Hopefully I have found the issue and the fix.

    Apparently, there is nothing wrong with Qt.
    I looked in the source code for QtCreator on this page:
    https://code.woboq.org/qt5/qt-creator/src/plugins/projectexplorer/msvctoolchain.cpp.html
    (That may not be latest, however it gave me idea how QtCreator looks for the vcvars bat files.)
    It looks in the registry.
    For some strange reason, the path for VC was stored as
    C:Program Files (x86)Microsoft Visual Studio2017Community
    instead of
    D:Program Files (x86)Microsoft Visual Studio2017Community
    I do not know why!!

    So I manually fixed it in the registry to
    D:Program Files (x86)Microsoft Visual Studio2017Community
    and restarted QtCreator, went to kits………it gave me all the possible combinations to choose VC compiler
    I chose amd64_x86………..and everything is working okay
    I have test built one example project (textedit) and it seems to be running well.

    I will still keep watch on both Qt and our other projects is this registry setup change creates any other issues.

    Thanks for your support and clues.

  • @mvelanka wow — good observation! glad you got it running. So please mark this topic as SOLVED now. Thanks!

    • Home
    • Forum
    • Qt
    • Qt Programming
    • MSVC 2017 32-bit can’t run qmake

    1. 3rd October 2020, 15:02


      #1

      Default MSVC 2017 32-bit can’t run qmake

      Hi, i want to install a QtXlsx (to create excel files).
      I installed it on MinGW doing this:

      cd %directory%
      qmake
      And everything was ok.
      Now i want to use it on MSVC 2017 32-bit.

      I do:
      cd %directory%
      qmake
      It says:
      Project ERROR: Cannot run compiler ‘cl’. Output:
      ===================
      ===================
      Maybe you forgot to setup the environment?

      How can i fix this? When i write just qmake, it gives me some tips how to use it.


    2. 3rd October 2020, 18:48


      #2

      Default Re: MSVC 2017 32-bit can’t run qmake

      You need to open a Visual Studio Command Prompt window. Go to the Start -> Programs menu, find Visual Studio 2017 -> Visual Studio Tools -> MSBuild command prompt. From that command window, cd to your project and run qmake.

      The command prompt sets up the environment so build tools can find your compiler, linker, libraries, etc. If you have cross-compilers or other VS tools installed, you can find more specific environments under the Visual Studio Tools -> Windows Desktop Command Prompts menu.

      <=== The Great Pumpkin says ===>
      Please use CODE tags when posting source code so it is more readable. Click «Go Advanced» and then the «#» icon to insert the tags. Paste your code between them.


    Similar Threads

    1. Replies: 4

      Last Post: 9th September 2019, 00:42

    2. Replies: 4

      Last Post: 18th June 2019, 10:04

    3. Replies: 3

      Last Post: 19th March 2019, 18:22

    4. Replies: 2

      Last Post: 24th November 2007, 13:06

    5. Replies: 3

      Last Post: 13th September 2007, 07:40

    Bookmarks

    Bookmarks


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    • BB code is On
    • Smilies are On
    • [IMG] code is On
    • [VIDEO] code is On
    • HTML code is Off

    Forum Rules

    Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.

    This topic has been deleted. Only users with topic management privileges can see it.

  • Hello!
    I am facing this problem while trying to install qwt.
    The command «qmake qwt.pro» gives me the aforementioned error.
    I understood that it probably has to do with the environment, so I added to the environment variables the path to the qmake (C:QtQt5.9.15.9.1msvc2015_64bin) as well as the path to the vcvarsall.bat (C:Program Files (x86)Microsoft Visual Studio 14.0VC), but I still have this problem.

    Any help?
    Thanks a lot in advance!

    [Edit: moved to 3rd Party Software ~~ @Wieland]

  • @vassia

    Hi and welcome to devnet forum

    @vassia said in Project ERROR: Cannot run compiler ‘cl’. Maybe you forgot to setup the environment?:

    I understood that it probably has to do with the environment, so I added to the environment variables the path to the qmake (C:QtQt5.9.15.9.1msvc2015_64bin) as well as the path to the vcvarsall.bat (C:Program Files (x86)Microsoft Visual Studio 14.0VC), but I still have this problem.

    I might be wrong, but it looks to me that you are using a pre-compiled Qt version for MSVC 2015 64 bit.
    Based on the path you appear to have Visual Studio 2015 32 bit. Please verify, if those assumptions are correct.

    You cannot freely mix 32 bit and 64 bit versions. This could be the problem in your setup.

    Please ensure that compiler and pre-compiled Qt library version are for the same architecture. Either 32 or 64 bit.

  • Thank you very much for the reply!
    Everything you wrote was correct. Indeed I have Qt for both MSVC 2015 64 bit and MSVC 2015 (32 bit). I finally succeeded to install qwt.
    So, the steps I followed in order to install qwt-6.1.3 (in case someone faces the same problem) are:

    1. extracted Qwt source zip file to: C:Qwt-6.1.3
    2. ran as administrator «Qt 5.7 64-bit for Desktop (MSVC 2015)»
    3. moved into: cd C:Program Files (x86)Microsoft Visual Studio 14.0VC
    4. then executed: vcvarsall.bat amd64
    5. then moved into Qwt folder: cd C:Qwt-6.1.3
    6. ran: qmake qwt.pro
    7. then ran: nmake
    8. and finally ran: nmake install

    Thanks again!

  • @vassia

    Thanks for reply and good to know that I could help.

    Since the issue has been solved for you, please mark also your post as solved. This helps others to see that there might be a solution.

    In order to mark as solved, go to the compobox named «Topic Tools» after your first post or after the last post in the thread and select «Mark as Solved».

  • Я установил Qt в Windows в соответствии с инструкциями, но когда я создал приложение Qt Widget, я получаю следующую ошибку:

    Running Windows Runtime device detection.
    No winrtrunner.exe found.
    Project ERROR: Cannot run compiler 'cl'. Maybe you forgot to setup the environment?
    

    Кроме того, в моем каталоге проекта Qt Creator я не вижу ничего, кроме своего .pro файл.

    Я пробовал с этот ответ, но не смог получить никакого результата.

    В моей папке установки Qt, когда я открываю Tools папка, она просто имеет QtCreator папка и нет папки компилятора.

    • Установлено Qt: 5.9.1
    • IDE: Qt Creator

    Как исправить эту ошибку?

    6

    Решение

    Так что после долгих усилий и исследований я наконец смог установить Qt и запустить программу, используя Qt Creator в Windows.

    • Для запуска Qt вам нужен компилятор и отладчик, который не предусмотрен по умолчанию.
    • Если вам просто нужно запустить программу только для Qt и дополнительные библиотеки, которые вы будете использовать, будут компилироваться с использованием MinGW, то вы можете выбрать MinGW в качестве компилятора во время установки с помощью онлайн-установщика Qt.
    • Но в большинстве случаев мы сначала будем устанавливать Visual Studio. Выберите C ++ / CLI в флажке, так как он не выбран по умолчанию.
    • После установки Visual Studio нам понадобится отдельный CDB отладчика, чтобы связать Qt с VS. Для этого вам нужно удалить текущий комплект разработки программного обеспечения Windows и снова установить с Вот, или измените установку в приложении «Настройки Windows». Во время установки не забудьте выбрать Debugging Tool For Windows. Причиной удаления ранее было то, что если мы установим снова с новой выбранной опцией, она не отменит предыдущую установку.
    • Теперь откройте проект Qt. Идти к Tools > Options > Build & Run > Debuggers и вы можете видеть, что отладчик должен быть обнаружен автоматически.
    • Теперь перейдите на вкладку наборы и выберите обнаруженный отладчик. Для компилятора выберите нужный компилятор, вы увидите предупреждение о том, что компилятор несовместим, но вы можете игнорировать это при запуске программы. (Не забудьте выбрать Применить).

    2

    Другие решения

    Других решений пока нет …

    Понравилась статья? Поделить с друзьями:
  • Project error building qtqml requires python
  • Project e как изменить emc предмета
  • Project cars 3 как изменить имя
  • Project build error non resolvable parent pom for
  • Progressnotificationcommon dll citrix ошибка при установки