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. Qt in Visual Studio 2012

Qt in Visual Studio 2012

Scheduled Pinned Locked Moved Installation and Deployment
26 Posts 8 Posters 29.0k 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.
  • M Offline
    M Offline
    mulfycrowh
    wrote on 16 Feb 2013, 20:02 last edited by
    #1

    HI !
    I tried installing QT in Visual Studio 2012 without any sucess.
    I downloaded the source code (zip file) for Qt 4.8 and unzipped it in the folder C:\Qt\4.8.
    i opened the command window VS2012 x64 Native Tools then typed
    cd C:\Qt\4.8
    set CL=/MP
    configure -developer-build -opensource -opengl desktop

    I have got all the gossip from configure command syntax and nothing more.
    The system is not asking for license and so on ...

    Do you have any idea ? I use Visual Studio Premium.

    Many thanks

    edit: please don't shout, also not in titles; Andre

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tzander
      wrote on 16 Feb 2013, 20:05 last edited by
      #2

      You need a newer version of Qt that supports this very recent compiler. Qt 4.8 was released far before VS2012 was.
      I think 5.0.1 supports VS2012.

      Also please consider using QtCreator, its quite a bit better than Visual Studio IMOHO.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mulfycrowh
        wrote on 16 Feb 2013, 20:45 last edited by
        #3

        Thanks for reply. I tried with QT 5 and I didn't succeed in launching configure

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tzander
          wrote on 16 Feb 2013, 22:47 last edited by
          #4

          Building Qt5 is different, search on this site and the wiki for more details.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mulfycrowh
            wrote on 16 Feb 2013, 23:42 last edited by
            #5

            Trying to launch configure but again without any sucess with VS 2012. We are in 2013 not 2010 ! Where can I find Qt source 5.0.0 ?
            Seems to be OK following a youtube tuto.

            Very disappointed. It takes more time to make QT VS 2012 compliant than to write a few hundreds lines to get the UI I want.

            Thanks to QT staff to help the sooner the better

            1 Reply Last reply
            0
            • J Offline
              J Offline
              JKSH
              Moderators
              wrote on 17 Feb 2013, 01:55 last edited by
              #6

              What problems are you experiencing? I can vouch that MSVC 2012 32-bit can compile Qt 5 on Windows 8 64-bit without much trouble.

              See also http://qt-project.org/wiki/Building-Qt-5-from-Git , which says "To properly configure and build Qt 5 from source you also need Perl (>=5.14) and Python (>=2.6.x), as well as a working compiler."

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

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mulfycrowh
                wrote on 17 Feb 2013, 11:17 last edited by
                #7

                I installed Active Perl 64 bits and Python (x86 and x64), launched nmake and about one hour later I got 5 fatal errors that are U1077 'cd' : return code 0x2.

                I guess that I am facing big trouble. Am I not ?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mulfycrowh
                  wrote on 17 Feb 2013, 14:45 last edited by
                  #8

                  At the end I can read :

                  'python' is not recognized as an internal or external command.
                  Then first error U1077 'python' return code 0x01
                  Then second error about nmake.exe return code 0x02
                  Then third, fourth and fifth errors return code 0x02

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on 17 Feb 2013, 20:09 last edited by
                    #9

                    You need to add perl and python to your PATH. Either by setting it globally in the system settings or for this session in the command line before you run nmake:
                    @
                    set PATH=%PATH%;C:\PathToPerl;C:\PathToPython
                    @
                    The good news is you don't need to restrat from scratch. If you get that error fix your PATH and type nmake again, it will pick up where it sopped.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      JKSH
                      Moderators
                      wrote on 17 Feb 2013, 23:08 last edited by
                      #10

                      Hmm.. the ActivePerl and ActivePython installers should have updated the system PATH automatically. Try restarting your computer first; Windows won't see the updated PATH otherwise

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

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        Chris Kawa
                        Lifetime Qt Champion
                        wrote on 17 Feb 2013, 23:16 last edited by
                        #11

                        [quote author="JKSH" date="1361142534"]Try restarting your computer first; Windows won't see the updated PATH otherwise[/quote]
                        That's actually no longer true starting from (I think)Vista. Win7/8 for sure. Just re-open a console and you're good to go.
                        I might be wrong, but from what I recall installers ask you if you want them to update your PATH and at least for one of them it was not the default.
                        Personally, if I can, I try not to pollute the global PATH and just include what I need on a per console session basis. All sort of crazy errors occur when there are conflicting things there (eg. git on windows is a very naughty piece of software).

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mulfycrowh
                          wrote on 20 Feb 2013, 10:27 last edited by
                          #12

                          Guys and girls I would like to thank you because it runs !

                          On Windows 7 :

                          I downloaded Perl and Python 32 bits then the Qt source version 5.0
                          I created a folder C:\Qt\5.0.1 and put the zip file on it.
                          Unzipped it.

                          Before starting the configuration you have to set your environmental variables to tell the system where you put Perl and Python. So :
                          Start > Right Click on Computer icon > Properties > Advanced System Settings > Advanced > Environment Variables > System Variables.
                          Select the variable "Path" and select "Edit". Do not delete what is written in this variable and add ";" (if not present) C:\Path to Perl.exe add another ";" C:\Path to Python.exe
                          Save and quit the dialog box.

                          Then Start > Microsoft Visual Studio 2012 > Visual Studio Tools > Open VS2012 x64 Native Tools Command Prompt
                          First of all you have to change your folder with the command :
                          cd C:\Qt\5.0.1\qt-everywhere-opensource-src-5.0.1
                          Then type :
                          SET CL=/MP
                          Then type :
                          configure -developer-build -opensource -opengl desktop (-nomake tests -nomake examples)
                          The ones in brackets are optional - do not type in the brackets.
                          You should accept the license by entering "y".
                          After a while (2-3 minutes) type in:
                          qmake
                          It takes a very long time : about 3 hours (i7 - 2670QM@2,2 GHz).

                          Then browse to Qt Project Website > Other Downloads and download Visual Studio Add-in 1.2.0 for Qt5 and run it.

                          Launch Visual Studio 2012. You should see Qt5 on the main bar. Select it and go to "Qt Options" > Add and enter a name for the version name and enter the path where you have qmake.exe (you should find it in the folder "bin". Save your selection.

                          You're now ready starting using Qt in VS 2012 !

                          That's All Folks !

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mulfycrowh
                            wrote on 20 Feb 2013, 16:04 last edited by
                            #13

                            Now tre trouble comes when I want to compile a Qt Project.
                            I've got a linkage error LNK 1112.
                            This is a conflict between 32 and 64 bits.

                            How can I manage it ?

                            Thanks

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              mulfycrowh
                              wrote on 20 Feb 2013, 17:14 last edited by
                              #14

                              I solved the issue by using VS 2012 x86 Native Tools Command Prompt instead.

                              1 Reply Last reply
                              0
                              • O Offline
                                O Offline
                                Olorin5800
                                wrote on 21 Feb 2013, 09:09 last edited by
                                #15

                                Consider adding [SOLVED] in the post title


                                My programs never have bugs, they just develop random features.

                                1 Reply Last reply
                                0
                                • N Offline
                                  N Offline
                                  Neptun
                                  wrote on 17 Mar 2013, 12:47 last edited by
                                  #16

                                  I checked this today, works fine for Windows 7 x64 Ultimate with VS 2012 x64 Ultimate. There is a small mistake in last point "After a while (2-3 minutes) type in: qmake" command prompt returned "no such command" and I had to use "nmake". Another tip :D form "http://qt-project.org/wiki/Building_Qt_Desktop_for_Windows_with_MSVC" after finishing build of all files run @nmake clean
                                  cd qttranslations
                                  nmake@

                                  1 Reply Last reply
                                  0
                                  • D Offline
                                    D Offline
                                    daniel347x
                                    wrote on 5 Apr 2013, 23:00 last edited by
                                    #17

                                    I'd like to suggest that these notes be formalized and displayed prominently in an article linked on the home page. I am a newcomer to Qt, but I am an experienced C++ programmer and I use VS 2012.

                                    It seems to me that integration instructions for Microsoft's current development environment, as of April 2013, might rightfully be considered of paramount importance in terms of a "getting started on Windows" guide.

                                    That way, a user who wishes to integrate Qt with Microsoft's most current IDE will not have to dig through forum postings, as I have had to do.

                                    Thanks,
                                    Dan

                                    1 Reply Last reply
                                    0
                                    • J Offline
                                      J Offline
                                      Jemar
                                      wrote on 9 Apr 2013, 04:29 last edited by
                                      #18

                                      Hey guys. I've been working on a community wiki on stackoverflow for this exact problem. It's certainly not perfect and I think needs some work from people who know more than I, but it's a start: http://stackoverflow.com/questions/15826893/getting-qt5-to-install-and-work-with-visual-studio-2012/15893226#15893226

                                      1 Reply Last reply
                                      0
                                      • D Offline
                                        D Offline
                                        daniel347x
                                        wrote on 10 Apr 2013, 17:55 last edited by
                                        #19

                                        I have carefully followed the steps to build Qt on Windows 7 64-bit (but building Qt in 32-bit mode) in the linked StackOverflow Community Wiki (see previous comment for link), but I cannot overcome the following error while running nmake:

                                        "c1xx : fatal error C1083: Cannot open source file: '.rcc\debug_shared\qrc_mimetypes.cpp': No such file or directory."

                                        (And, indeed, there is no "qrc_mimetypes.cpp" file anywhere in my Qt folder or its subfolders.)

                                        I have posted a new StackOverflow question here: http://stackoverflow.com/questions/15932767/missing-qrc-mimetypes-cpp-while-attempting-to-build-qt-on-windows-7-32-bit-bu

                                        Any help would be appreciated. It seems that building Qt on Windows is not straightforward, even when following all directions with meticulous care. Thanks!

                                        1 Reply Last reply
                                        0
                                        • D Offline
                                          D Offline
                                          daniel347x
                                          wrote on 11 Apr 2013, 10:42 last edited by
                                          #20

                                          I have resolved the problem to be a catastrophic bug with the Avast! antivirus sandbox. Only a complete uninstallation of Avast! suffices; as long as Avast! remains installed on the system, it is impossible under any circumstances to build Qt.

                                          See http://stackoverflow.com/q/15932767/368896.

                                          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