Visual Studio 2013. QT Creator needs a compiler setup to build



  • First, apologies, I realized I posted this to the wrong section...

    HI all, new guy here to QT. Been developing for many years in the Microsoft world. Wanting to get back into C++ and wanted something other than MFC to develop in. Had hear of QT in the past so I decided to start looking into it.

    I downloaded the latest build QT 5.2.0 For Windows 64 Bit (vs2012, opengl).
    After the download I ran the installer.
    It seemed to unpack everything fine.
    I ran QT creator,
    I see a bunch of example apps
    Tried to run one of them, but while compiling I'm getting the error QT creator needs a compiler setup to build. Configure a compiler in the kits options.

    Went to tools -> options. Looked at the Kits tab
    Under Auto Detect, I see a red stop sign Desktop QT 5.2.0 MSVC2012 OpenGL 64Bit. I'm assuming this means there is an error with something to do with Open GL and MSVC2012.

    Clicked on Manual hoping to create my own entry.
    I seen where I can define my own compiler under the compilers tab.
    Problem is, there is no way to manually select Visual Studio 2013...

    So, this makes me wonder... is it possible to use QT 5.2.0 with the Visual Studio 2013 compiler?
    If not, what options do I have? I've never heard of any of the other compilers that you can pick on the compilers page. I have not downloaded any of them.

    Also, I've read a little bit about a plugin for Visual Studio. There seems to be a few threads about it. But even after reading them I'm still a little confused rather or not the plugin works with VS2013 and if so, how to get it setup. What exactly does the plugin provide? Is it a complete substitute for QT Creator which would give you a visual designer within Visual Studio?

    Any help will be greatly appreciated!!
    Thanks Rick


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can't use the VS2012 Qt 5.2 version with Visual Studio 2013, however you can build Qt with VS2013. This is valid for any VS Qt package, the compilers much match.

    The list of compilers include the various architecture supported by VS x86/x86_64/maybe Itanium

    The plugin will provide Qt integration in Visual Studio. This includes additional steps like mod/rcc/uic run.

    IIRC, there's work in progress for the Addin to work in VS2013

    Hope it helps



  • [quote author="SGaist" date="1389472103"]Hi and welcome to devnet,

    You can't use the VS2012 Qt 5.2 version with Visual Studio 2013, however you can build Qt with VS2013. This is valid for any VS Qt package, the compilers much match.[/quote]
    Does this mean then that I would be able to compile QT with VS2013, then use VS as my compiler settings in Creator?

    [quote author="SGaist" date="1389472103"]
    This includes additional steps like mod/rcc/uic run.
    IIRC, there's work in progress for the Addin to work in VS2013
    [/quote]

    Sorry, don't know what those acronyms mean. :)

    Greatly appreciate your input.


  • Lifetime Qt Champion

    Yes and yes

    Those are not acronyms (in fact they also are but…), they are the various tools used for the magic to happen.

    moc is the Meta Object Compiler: responsible for the code generated that does the signals and slots stuff and much more.

    rcc is the resource compiler: creates a c++ compilable file to embed binary files like icons (not suite for big files and not the purpose)

    uic is the ui compiler: transforms a ui file (user interface generated xml file from designer) in it's c++ counterpart for building

    By the way, It's Qt, QT stands for Apple QuickTime :)



  • Sorry, I'll use proper terminology.. Qt...

    I've not done much, if any command line building when using Visual Studio, I've always just used the Build menu within Visual Studio. If I want to build Qt so that it will run with VS2013, what would the steps be? What would the command line look like?


  • Lifetime Qt Champion

    You can follow the "windows installation guide":http://qt-project.org/doc/qt-5.0/qtdoc/install-win.html and correct the needed paths for VS2013



  • Hi Sgalst...

    What is this statement right here?

    set QMAKESPEC=win32-msvc2010

    Would I just change msvc2010 to msvc2013 Is it that simple? Or am I looking for a particular executable file?


  • Lifetime Qt Champion

    No no, that should be enough, IIRC using the Visual Studio command prompt you shouldn't even need that (but it won't hurt)



  • Hi SGalst..

    Is there an absolute idiot's guide to this entire step 3? Because as much as I hate to admit it, I'm pretty lost here.

    bq.
    Step 3: Set the Environment variables
    We recommend creating a desktop link that opens a command prompt with the environment set up similar to the Command Prompt menu entries provided by the Windows SDKs. This is done by creating an application link passing a .cmd file setting up the environment and the command line option /k (remain open) to cmd.exe.
    Assuming the file is called qt5vars.cmd and the Qt folder is called qt-5 and located under C:\qt:
    REM Set up Windows SDK for 64bit
    CALL "C:\Program Files (x86)\MSVC10\VC\vcvarsall.bat" amd64
    set PATH=c:\qt\qt-5\qtbase\bin;c:\qt\qt-5\qtrepotools\bin;c:\qt\qt-5\gnuwin32\bin;%PATH%
    set QMAKESPEC=win32-msvc2010
    A desktop link can then be created by specifying the command %SystemRoot%\system32\cmd.exe /E:ON /V:ON /k c:\qt\qt5vars.cmd as application and c:\qt\qt-5 as working directory.
    Note: Setups for MinGW are similar; they differ only in that the bin folder of the installation should be added to the path instead of calling the Windows SDK setup script. For MinGW, please make sure that no sh.exe can be found in the path, as it affects mingw32-make.
    Settings required by the additional libraries (see Qt for Windows Requirements) should also go this file below the call to the Windows SDK setup script.
    Step 4: Build the Qt Library
    bq.


  • Lifetime Qt Champion

    Try the extremely simple way:

    • Start the command prompt from Visual Studio
    • Call configure with the needed options
    • Call nmake

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.