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. Cannot compile. Please help!

Cannot compile. Please help!

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 4 Posters 2.5k 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.
  • S Offline
    S Offline
    SweetOrange
    wrote on last edited by
    #1

    Hi! I am new to Qt and I currently revising C++

    I have created this simple program:

    @#include <QCoreApplication>
    #include <QDebug>

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    qDebug() << "hello world";
    
    return a.exec&#40;&#41;;
    

    }@

    When I press Run I get the following error messsage: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.

    So I went to Tools>Options and selected Build&Run and Compilers tab. There is the Microsoft Visual C++ Compiler 12.0 (x86) under the Auto-detected option. I installed MinGW compiler for windows 32-bit and I added it to the Compilers. I selected MinGW as the compiler and pressed Run and i got the same error message. Have i done something wrong in the installation or configuration of the compiler?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What version of Qt did you installed ?

      If it's a Visual Studio version, you need to match the version e.g. Visual Studio 2010 for the VS2010 package. They can't be mixed accross different version and you can't use MinGW with that version of Qt.

      If you installed the MinGW version, please remove any external version. This package comes with a known working version of MinGW

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SweetOrange
        wrote on last edited by
        #3

        Thanks SGalst.

        I think I have installed the VS2010, OpenGL package. I do have Visual Studio 2013 Premium on my machine though.

        Is MinGW an IDE as Visual Studio?

        If yes then I will remove the MinGW compiler and i will download the VS2012 package and I will uninstall Visual Studio 2013 and i will install Visual Studio 2012 (Premium or Ultimate? from piratebay. Do you know any working Visual Studio 2012 torrent?)

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          No, MinGW is not an IDE.

          As I see you are using Qt creator as an IDE. MinGW is an opensource compiler. It works well with Qt creator, but you have to install the pre-build for MionGW for Qt libs.

          You can use also VS compilers with Qt creator, but you have to pay close attention to the version you are using. The different VS compiler are not compatible between versions.

          You use the online installer for the SDK for MinGW from the download page. It does give you also an opportunity to install directly MinGW compiler.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            To add to koahnig, there are currently no pre-built packages for VS2013, you would have to build Qt yourself.

            Microsoft provides the Express edition free of charge for Visual Studio (it has a few restriction though)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              [quote author="SweetOrange" date="1392659827"]I think I have installed the VS2010, OpenGL package.[/quote]Then you can get your setup to work by installing the VS2010 compiler. You can't download Visual Studio 2010 any more, but the same compiler exists in "Windows SDK 7.1":http://www.microsoft.com/en-au/download/details.aspx?id=8279

              Note that if you get the OpenGL package, your system's graphics drivers must support OpenGL 2.0 or higher.

              [quote]i will install Visual Studio 2012 (Premium or Ultimate? from piratebay. Do you know any working Visual Studio 2012 torrent?)[/quote]We don't condone piracy here.

              The free Express edition provides all the same benefits as the Ultimate edition if you use Qt Creator as your IDE.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SweetOrange
                wrote on last edited by
                #7

                I have installed Qt creator with MinGW. Now it compiles and run the code.
                This problem solved!

                1 Reply Last reply
                0

                • Login

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