Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

need help in setting Build & Run option after importing an existing project



  • hi,

    I am importing an existing project downloaded from github. But I could not understand how to set build and run options for that as I have installed several versions of Qt hence Qt creator shows all the available tools in "Auto-detected" but how to make a particulate compiler and qmake active?

    I want to use MSVC 2017 compiler and its qmake. Please see below in snaps.

    3_1547055822866_4.jpg 2_1547055822866_3.jpg 1_1547055822866_2.jpg 0_1547055822865_1.jpg

    Thanks...


  • Lifetime Qt Champion

    Hi @ravi2k18,

    Creator needs to auto-detect the Visual Studio C++ compiler - you cannot set them up manually.

    • Did you install Visual C++ to the default path?
    • Is there a vcvars*.bat in the Visual Studio installation directory?


  • if we can not install manually then what is manual section in build & run ?

    I have installed VS 2017 community version

                  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd\ext
    

    What do you mean by installing VS 2017 in default path ? what is default path in my case ?

    I have qt installed in the below path

            C:\Qt\Qt5.12.0

  • Lifetime Qt Champion

    @ravi2k18

    • Did you install Visual C++ ? That has to be selected separately during the installation.
    • Did you change the path during the Visual C++ installation or did you keep the defaults?


  • @aha_1980

    Did you install Visual C++ ?

    I have installed VC++ using MS Visual studio 2015 iso download from Microsoft site.

    Did you change the path during the Visual C++ installation ?
    Yes. While installation I just used the non default path given below

                               C:\Program Files (x86)\Microsoft Visual Studio\2015


  • so I have installed VS 2015 with VC++ and tried to re import the code and configure the build and run settings as shown in below snaps. However still geting some build errors as given below.

    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(173): 'getenv' is not a recognized replace function.
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(175): 'getenv' is not a recognized replace function.
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(196): system(execute) requires one or two arguments.
    Project ERROR: Cannot run compiler 'cl'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(240): Variable QMAKE_CXX.COMPILER_MACROS is not defined.
    Project ERROR: msvc-version.conf loaded but QMAKE_MSC_VER isn't set
    Error while parsing file C:\Qt-Workspace\OnvifDiscoveryLib\OnvifDiscoveryLib.pro. Giving up.
    Warnings while parsing QML type information of C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/qml:
    C:\Qt\Qt5.12.0\5.12.0\msvc2017_64\qml\builtins.qmltypes:1:24: Reading only version 1.1 parts.
    C:\Qt\Qt5.12.0\5.12.0\msvc2017_64\qml\builtins.qmltypes:10:5: Expected only Component and ModuleApi object definitions.
    
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(173): 'getenv' is not a recognized replace function.
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(175): 'getenv' is not a recognized replace function.
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(196): system(execute) requires one or two arguments.
    Project ERROR: Cannot run compiler 'cl'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    C:/Qt/Qt5.12.0/5.12.0/msvc2017_64/mkspecs/features/toolchain.prf(240): Variable QMAKE_CXX.COMPILER_MACROS is not defined.
    Project ERROR: msvc-version.conf loaded but QMAKE_MSC_VER isn't set
    Error while parsing file C:\Qt-Workspace\OnvifDiscoveryLib\OnvifDiscoveryLib.pro. Giving up.
    

    @aha_1980

    below is the snap of build and run

    0_1547068080683_1.jpg

    0_1547068090740_2.jpg

    0_1547068109765_3.jpg

    0_1547068116635_4.jpg

    0_1547068123419_5.jpg

    0_1547068135776_6.jpg


  • Lifetime Qt Champion

    @ravi2k18 as said, you cannot set up the compiler manually. remove that one and use the auto-detected.

    I'm on the mobile now and can hardly read your screen (most of the pic is uninteresting), so I cannot tell you if there is more wrong.



  • @aha_1980

    Now I am using automatic kit Desktop Qt 5.12.0 MSVC2017 64bit
    however while building the project I am getting below err.

                       File Makefile doesn't exist.
    

    why VC++ project will use Makefile here? when has *.pro file.
    How can I fix this?

    Thanks....


  • Lifetime Qt Champion

    @ravi2k18 qmake generates a makefile, which is processed by nmake/jom.

    I'd suggest you to create a simple example with the wizard first and see if that compiles.



  • @aha_1980

    when i create new "hello world" project by using empty qmake project template, it runs successfully.
    However when I try to import the same dir as existing project after deleting generated .pro.user, it gives me

                     ":-1: error: No rule to make target 'all'.  Stop." 
    

    any idea what I am doing wrong in importing the working exciting project here.

    thanks...


  • Lifetime Qt Champion

    @ravi2k18 make sure to delete all build artifacts and Makefiles. it should work.


Log in to reply