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

unable to compile existing github project in qt



  • Hi,
    I want to build and run following existing github project in qt.

            https://github.com/hummatli/onvif-qt-server-client/tree/master/onviflibs
    

    As per the project description I installed Qt 5.5.0(MSVC 2013, 32 bit) with IDE Qt Creator 3.4.2
    deleted existing OnvifLibs.pro.user and opened OnvifLibs.pro file in Qt creator. However when I try to build the project
    I see below error

           Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.
    

    Debugging the issue further I see compiler path is not set in Tools ---> Build and run option. See snaps down.
    I tried to set the path manually however no idea where is msvc compiler's exe.
    Do we need to install msvc 2013 sparatoely to work. I do not find cl command in below qt's msvc dir.

        C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin\
    

    Can any one please help me?

    2_1546975456972_3.jpg 1_1546975456972_2.jpg 0_1546975456971_1.jpg

    thanks...



  • Do you have the MSVC 2013 64 bit compiler installed on your system?

    To be clear it appears you do not. You do seem to have prebuilt binaries of the Qt framework but not the compiler itself which will be required to build your project's source code.



  • as per my understating when i use any offline installer like

                       qt-opensource-windows-x86-msvc2013_64-5.5.0.exe
    

    it should have msvc compiler included in installation. otherwise what is the point naming -msvc2013_64-5.5.0.exe
    here?

    If it does not have msvc compiler then what is the below msvc directory?

                   C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin   
    

    BTW if compiler is not installed then from where I can install MSVC2013 ?
    Do I need to install whole visual studio 2013 framework for that ?

    thanks...


  • Lifetime Qt Champion

    @ravi2k18
    Hi
    the visual studio compiler is never included as its forbidden by microsoft.

    The folder
    C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin
    contains a binary Qt that is compiled with visual studio compiler so it can work with that.

    Compilers cannot use each other libraries. so Qt must be compiled with same compiler that is to be used to make user apps.

    You download visual studio from microsoft.
    If you want to use 5.5 and vs2013, you must find the older installer as a new 2017 wont work with that Qt version.



  • does it mean to build and run this open source github project I need to purchase full Visual Studio 2013 and install that?
    any other shorter option?

    thanks


  • Lifetime Qt Champion

    Hi,

    No, there was a community edition of it.

    However since Qt is backward compatible, you should rather consider using 5.12 and a recent version of Visual Studio.


  • Lifetime Qt Champion

    @ravi2k18 To add to @SGaist you can use Qt with MinGW if the project does not require MSVC...



  • I am new to Qt and only worked on Linux environment so far. How can I verify that the below github project does not use MSVC and can work on MinGW ?

                           https://github.com/hummatli/onvif-qt-server-client
    

    Moreover this project has multiple .pro and .pro.user files recursively under each dir of OnvifServer, onviflibs and OnvifClientTest.
    However no .pro and .pro.user in TOP dir. Do I need to consider and import all tree dirs as independent projects? What about recursive .pro and .pro.users inside them?

    ./OnvifServer/OnvifServer.pro.user
    ./OnvifServer/OnvifServer.pro
    ./onviflibs/onvifcore/OnvifDeviceLib/OnvifDeviceLib.pro.user
    ./onviflibs/onvifcore/OnvifDeviceLib/OnvifDeviceLib.pro
    ./onviflibs/onvifcore/OnvifEventLib/OnvifEventLib.pro
    ./onviflibs/onvifcore/OnvifEventLib/OnvifEventLib.pro.user
    ./onviflibs/onvifcore/OnvifDiscoveryLib/OnvifDiscoveryLib.pro.user
    ./onviflibs/onvifcore/OnvifDiscoveryLib/OnvifDiscoveryLib.pro
    ./onviflibs/OnvifPTZLib/OnvifPTZLib.pro.user
    ./onviflibs/OnvifPTZLib/OnvifPTZLib.pro
    ./onviflibs/OnvifAnalyticsLib/OnvifAnalyticsLib.pro.user
    ./onviflibs/OnvifAnalyticsLib/OnvifAnalyticsLib.pro
    ./onviflibs/OnvifReplayControlLib/OnvifReplayControlLib.pro
    ./onviflibs/OnvifReplayControlLib/OnvifReplayControlLib.pro.user
    ./onviflibs/OnvifMediaLib/OnvifMediaLib.pro.user
    ./onviflibs/OnvifMediaLib/OnvifMediaLib.pro
    ./onviflibs/OnvifReceiverLib/OnvifReceiverLib.pro
    ./onviflibs/OnvifReceiverLib/OnvifReceiverLib.pro.user
    ./onviflibs/OnvifLibs.pro.user
    ./onviflibs/OnvifVideoAnalyticsDeviceLib/OnvifVideoAnalyticsDeviceLib.pro.user
    ./onviflibs/OnvifVideoAnalyticsDeviceLib/OnvifVideoAnalyticsDeviceLib.pro
    ./onviflibs/OnvifRecordingSearchLib/OnvifRecordingSearchLib.pro.user
    ./onviflibs/OnvifRecordingSearchLib/OnvifRecordingSearchLib.pro
    ./onviflibs/OnvifDisplayLib/OnvifDisplayLib.pro.user
    ./onviflibs/OnvifDisplayLib/OnvifDisplayLib.pro
    ./onviflibs/OnvifLibs.pro
    ./onviflibs/OnvifDeviceIOLib/OnvifDeviceIOLib.pro
    ./onviflibs/OnvifDeviceIOLib/OnvifDeviceIOLib.pro.user
    ./onviflibs/OnvifImagingLib/OnvifImagingLib.pro
    ./onviflibs/OnvifImagingLib/OnvifImagingLib.pro.user
    ./onviflibs/OnvifRecordingControlLib/OnvifRecordingControlLib.pro
    ./onviflibs/OnvifRecordingControlLib/OnvifRecordingControlLib.pro.user
    ./OnvifClientTest/OnvifClientTest.pro
    ./OnvifClientTest/OnvifClientTest.pro.user

    When I try to import only onviflibs as project in qt5.12 with vs2017, it gives me several compilation errors. eg SOL_TCP not defined etc. Not sure why?

    Thanks...


  • Lifetime Qt Champion

    @ravi2k18

    That is a question better asked to the developer of that library.

    If there is no top-level pro file, it is poorly set up from build system view.

    Also, these .pro.user files should never be checked in, they should remain on the developers workstation.


  • Moderators

    @ravi2k18 said in unable to compile existing github project in qt:

    this project has multiple .pro and .pro.user files recursively under each dir

    The .pro.user files will probably cause errors on your machine. Delete them before you load the project.

    does it mean to build and run this open source github project I need to purchase full Visual Studio 2013 and install that?

    As others have suggested, ask the project maintainer if the project is compatible with other compilers.

    If it turns out that you must use MSVC 2013, you can get Visual Studio 2013 Express for free at https://visualstudio.microsoft.com/vs/older-downloads/ (but I believe you need to register an account)

    what is the point naming -msvc2013_64-5.5.0.exe
    here?

    The point is to inform the user that this library is compatible with MSVC 2013 64-bit. Therefore, the user cannot use this library with MSVC 2013 32-bit, MSVC 2015 64-bit, MinGW (GCC), and others.

    I am new to Qt and only worked on Linux environment so far.

    It's the same principle in Linux. If you want to use the wxWidgets library or gtkmm library, you still need to install the g++ compiler separately from the library.

    Qt is a C++ library (mostly), like wxWidgets and gtkmm.


Log in to reply