Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Qt creator doesn't compile with MVSC
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt creator doesn't compile with MVSC

Scheduled Pinned Locked Moved General and Desktop
15 Posts 3 Posters 6.9k Views 3 Watching
  • 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.
  • R Offline
    R Offline
    reezeus
    wrote on 23 Sept 2015, 11:25 last edited by reezeus
    #1

    Hi, Could you please help me to setup step by step Qt creator to compile with MSVC compiler? I need to integrate an external API which supports only MSVC compilers and I'm struggling with it.
    My knowledge of compilation is low, and there's nothing clear (at least for me) on the internet.
    I have installed MSVC 2013 + the Qt Add-in for MSVC.
    In Qt > Tools > Options > Build & Run, I have selected MVC++ Compiler 12.0(x86) instead of MinGW.
    I have setup two new environment variables, QTDIR & QMAKESTEP:
    http://img11.hostingpics.net/pics/868264enVar.png
    I have edited the PATH Variable to add this:
    http://img11.hostingpics.net/pics/511359enVarPath.png

    But it says there is not debugger setup:
    http://img11.hostingpics.net/pics/404071debugger.png

    And when trying to build (after running qMake), it shows the following message:
    http://img11.hostingpics.net/pics/270722errorMsg.png

    And line 711 is the following:
    C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin\moc.exe $(DEFINES) -D_MSC_VER=1800 -D_WIN32 -D_WIN64 -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/mkspecs/win32-msvc2013 -I//londc1/homes$/azzouz/GRM_DM -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/ActiveQt -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtWidgets -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtGui -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtANGLE -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtSql -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtCore -I. ..\GRM_DM\mainwindow.h -o debug\moc_mainwindow.cpp

    Can you help me please?

    J 1 Reply Last reply 23 Sept 2015, 14:36
    0
    • N Offline
      N Offline
      N.Sumi
      wrote on 23 Sept 2015, 12:53 last edited by
      #2

      Hi Reezeus ,

      Try this.

      Set Qt Dir : C:\Qt\5.5\msvc2013_64
      Path : C:\Qt\5.5\msvc2013_64\bin

      1 Reply Last reply
      0
      • R Offline
        R Offline
        reezeus
        wrote on 23 Sept 2015, 13:04 last edited by
        #3

        Hi N.Sumi

        Thanks.

        I have changed the path:
        http://img11.hostingpics.net/pics/544654enVar2.png
        http://img11.hostingpics.net/pics/862774enVar3.png
        But nothing changed. Actually those paths don't even exist in my C:\Qt folder:
        http://img11.hostingpics.net/pics/997416QtFolder.png

        1 Reply Last reply
        0
        • N Offline
          N Offline
          N.Sumi
          wrote on 23 Sept 2015, 13:22 last edited by N.Sumi
          #4

          hi,

          I don't know, why you Qt folder looks differently. Please check the path.I am confused little bit, have you kept Qt5.5 in the Qt 5.4? I prefer copy the Qt5.5 separately out side Qt5.4. In Qt 5.5, you will have mvsc 2012 & mvsc2013_64. Make path to mvsc2013_64. Can I know the package , actually you are using.

          Qt Open source installation: http://www.qt.io/download-open-source/#section-2 (for you, windows host: Qt 5.5.0 for Windows 64-bit (VS 2013, 650 MB)
          http://www.qt.io/download-open-source/

          1 Reply Last reply
          0
          • N Offline
            N Offline
            N.Sumi
            wrote on 23 Sept 2015, 13:31 last edited by
            #5

            In my case it is..
            http://www.hostingpics.net/viewer.php?id=556817Capture1.png
            http://www.hostingpics.net/viewer.php?id=465717Capture2.png
            http://www.hostingpics.net/viewer.php?id=685417Capture3.png

            1 Reply Last reply
            0
            • R Offline
              R Offline
              reezeus
              wrote on 23 Sept 2015, 13:43 last edited by
              #6

              I'm using Qt 5.5 now. I was working with version 5.4 but this morning I uninstalled it, downloaded the open source package "Qt 5.5.0 for Windows 64-bit (VS 2013, 650 MB) " and installed it (just a try when you are desperate...); and so the Qt installed in this folder:
              http://img11.hostingpics.net/pics/612927QtFolder1.png

              And here are the subfolders:
              http://img11.hostingpics.net/pics/158005QtFolder2.png
              http://img11.hostingpics.net/pics/776405QtFolder3.png
              http://img11.hostingpics.net/pics/238824QtFolder4.png

              1 Reply Last reply
              0
              • N Offline
                N Offline
                N.Sumi
                wrote on 23 Sept 2015, 13:50 last edited by
                #7

                okay..
                If you are using Qt5.5 now, then the path is

                Set Qt Dir : C:\Qt\QT5.5.0\5.5\msvc2013_64
                Path : C:\Qt\QT5.5.0\5.5\msvc2013_64\bin

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  reezeus
                  wrote on 23 Sept 2015, 14:01 last edited by
                  #8

                  Done, but nothing changed. I have run qmake again then try to build but it shows the same error message, at the same line of the Makefile.

                  1 Reply Last reply
                  0
                  • R reezeus
                    23 Sept 2015, 11:25

                    Hi, Could you please help me to setup step by step Qt creator to compile with MSVC compiler? I need to integrate an external API which supports only MSVC compilers and I'm struggling with it.
                    My knowledge of compilation is low, and there's nothing clear (at least for me) on the internet.
                    I have installed MSVC 2013 + the Qt Add-in for MSVC.
                    In Qt > Tools > Options > Build & Run, I have selected MVC++ Compiler 12.0(x86) instead of MinGW.
                    I have setup two new environment variables, QTDIR & QMAKESTEP:
                    http://img11.hostingpics.net/pics/868264enVar.png
                    I have edited the PATH Variable to add this:
                    http://img11.hostingpics.net/pics/511359enVarPath.png

                    But it says there is not debugger setup:
                    http://img11.hostingpics.net/pics/404071debugger.png

                    And when trying to build (after running qMake), it shows the following message:
                    http://img11.hostingpics.net/pics/270722errorMsg.png

                    And line 711 is the following:
                    C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin\moc.exe $(DEFINES) -D_MSC_VER=1800 -D_WIN32 -D_WIN64 -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/mkspecs/win32-msvc2013 -I//londc1/homes$/azzouz/GRM_DM -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/ActiveQt -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtWidgets -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtGui -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtANGLE -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtSql -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtCore -I. ..\GRM_DM\mainwindow.h -o debug\moc_mainwindow.cpp

                    Can you help me please?

                    J Offline
                    J Offline
                    JKSH
                    Moderators
                    wrote on 23 Sept 2015, 14:36 last edited by JKSH
                    #9

                    Hi @reezeus,

                    I have installed MSVC 2013 + the Qt Add-in for MSVC.

                    If you use Qt Creator as your IDE, then you don't need the Add-In. That's only for people who want to use Visual Studio as their IDE.

                    Uninstall the Visual Studio Add-In.

                    I have setup two new environment variables, QTDIR & QMAKESTEP:
                    http://img11.hostingpics.net/pics/868264enVar.png
                    I have edited the PATH Variable to add this:
                    http://img11.hostingpics.net/pics/511359enVarPath.png

                    Remove these. They are not necessary, and they can cause problems.

                    You don't need to set QTDIR or QMAKESPEC. You also don't need to add Qt to your PATH.

                    But it says there is not debugger setup:
                    http://img11.hostingpics.net/pics/404071debugger.png

                    Download and install Debugging Tools for Windows from the Microsoft website.

                    (Note: A debugger is very useful, but it's not strictly necessary. You can build and run programs without a debugger.)

                    And when trying to build (after running qMake), it shows the following message:
                    http://img11.hostingpics.net/pics/270722errorMsg.png

                    And line 711 is the following:
                    C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin\moc.exe $(DEFINES) -D_MSC_VER=1800 -D_WIN32 -D_WIN64 -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/mkspecs/win32-msvc2013 -I//londc1/homes$/azzouz/GRM_DM -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/ActiveQt -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtWidgets -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtGui -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtANGLE -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtSql -IC:/Qt/Qt5.5.0/5.5/msvc2013_64/include/QtCore -I. ..\GRM_DM\mainwindow.h -o debug\moc_mainwindow.cpp

                    I think the Makefile reader doesn't like the '$' in your folder name (homes$). Move your files to a different folder (which doesn't have '$' in its name) and try again.

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

                    1 Reply Last reply
                    1
                    • R Offline
                      R Offline
                      reezeus
                      wrote on 23 Sept 2015, 15:28 last edited by
                      #10

                      Hi JKSH

                      Thanks for your advices. I followed everything (deleting Paths, uninstall MVSC add-in and install Debugging tool for windows which is now recognized by Qt creator).
                      I have then created a new project and locate it in another drive/folder where there's no dollar sign (folder in the desktop basically).
                      the debugger doesn't show the error message relative to the Makefile, but it throws lots of errors (All the same) saying it cannot find my .obj files:
                      http://img11.hostingpics.net/pics/804880errorObjFiles.png

                      the "imp_blpapi_Event_release" things relate to the bloomberg API I'm using. However the file not found (and all the others) relate to class that I have written, like "workerIndexData" in the screenshot.

                      I have checked the forum before posting, there's an accepted answer that suggests to clear manually the folder "build-GRM_DMGT-Desktop_Qt_5_5_0_MSVC2013_64bit-Debug", then run qmake again and rebuild. I've done this but it doesn't change anything.

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        JKSH
                        Moderators
                        wrote on 23 Sept 2015, 15:51 last edited by
                        #11

                        You're welcome :)

                        @reezeus said:

                        it throws lots of errors (All the same) saying it cannot find my .obj files:

                        Ok, that means your compilation finished successfully, but the next step (linking) failed.

                        Those message don't mean that the system can't find your .obj files. Instead, it means that your .obj files need to access functions/variables from your Bloomberg library (these are the "external symbols"), but the system can't find your Bloomberg library.

                        In your .pro file, you must specify where to find your Bloomberg library. Add a line like this: LIBS += "C:/Path/to/Bloomberg/bloomberg.lib"

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

                        1 Reply Last reply
                        1
                        • R Offline
                          R Offline
                          reezeus
                          wrote on 23 Sept 2015, 16:49 last edited by
                          #12

                          Well, I've been struggling to find the correct syntax because I was specifying the path of the folder containing the Object File Library instead of the path to the file directly...
                          I have added this to the .pro file:
                          LIBS += "Z:/.../C++API/v3.8.18.1/lib/blpapi3_64.lib"
                          And suddenly it seemed to work.
                          But Qt creator asked me to setup debugging symbols for windows (I assume it recognized I was using a new debugger for the first time), I say yes and then it crashed with an error message "The CDB process terminated".
                          The problem is that now it happens every time I start debugging, without even a message in the debugging window, it appears as soon as I press F5.

                          J 1 Reply Last reply 24 Sept 2015, 14:01
                          0
                          • R Offline
                            R Offline
                            reezeus
                            wrote on 24 Sept 2015, 07:40 last edited by
                            #13

                            In fact I can't even run the app, the output tab shows this immediately after Ctrl + R:
                            Starting C:...\QtProjects\GRM_DMGT\build-GRM_DMGT-Desktop_Qt_5_5_0_MSVC2013_64bit-Debug\debug\GRM_DMGT.exe...
                            The program has unexpectedly finished.
                            C:...\QtProjects\GRM_DMGT\build-GRM_DMGT-Desktop_Qt_5_5_0_MSVC2013_64bit-Debug\debug\GRM_DMGT.exe crashed

                            1 Reply Last reply
                            0
                            • R reezeus
                              23 Sept 2015, 16:49

                              Well, I've been struggling to find the correct syntax because I was specifying the path of the folder containing the Object File Library instead of the path to the file directly...
                              I have added this to the .pro file:
                              LIBS += "Z:/.../C++API/v3.8.18.1/lib/blpapi3_64.lib"
                              And suddenly it seemed to work.
                              But Qt creator asked me to setup debugging symbols for windows (I assume it recognized I was using a new debugger for the first time), I say yes and then it crashed with an error message "The CDB process terminated".
                              The problem is that now it happens every time I start debugging, without even a message in the debugging window, it appears as soon as I press F5.

                              J Offline
                              J Offline
                              JKSH
                              Moderators
                              wrote on 24 Sept 2015, 14:01 last edited by
                              #14

                              @reezeus said:

                              And suddenly it seemed to work.

                              Good to hear!

                              But Qt creator asked me to setup debugging symbols for windows (I assume it recognized I was using a new debugger for the first time), I say yes and then it crashed with an error message "The CDB process terminated".
                              The problem is that now it happens every time I start debugging, without even a message in the debugging window, it appears as soon as I press F5.

                              Hmm... I don't have experience with CDB, so I can't help you here, sorry. (I use MinGW + GDB most of the time)

                              @reezeus said:

                              In fact I can't even run the app, the output tab shows this immediately after Ctrl + R:
                              Starting C:...\QtProjects\GRM_DMGT\build-GRM_DMGT-Desktop_Qt_5_5_0_MSVC2013_64bit-Debug\debug\GRM_DMGT.exe...
                              The program has unexpectedly finished.
                              C:...\QtProjects\GRM_DMGT\build-GRM_DMGT-Desktop_Qt_5_5_0_MSVC2013_64bit-Debug\debug\GRM_DMGT.exe crashed

                              The crash could be caused by many things, for example:

                              1. A bug in your code, OR
                              2. A bug in the Bloomberg library, OR
                                3, Incompatible libraries/DLLs

                              What version of MSVC was the Bloomberg library built with? (Note: Different versions of MSVC are not compatible with each other. If the Bloomberg library was built with MSVC 2010, then you must also use the MSVC 2010 version of Qt)

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

                              1 Reply Last reply
                              0
                              • R Offline
                                R Offline
                                reezeus
                                wrote on 28 Sept 2015, 10:07 last edited by
                                #15

                                Hi JKSH

                                I haven't checked the forum this week end, just saw your message.
                                Actually I find it out, although the solution doesn't make full sense for me:
                                When adding the external library using the Qt tool, I had ticked "Add 'd' suffix for debug version", which I believed was the thing to do since I work in debug mode and not release mode.
                                Now everything is fine, I have finally (!!) managed to compile The Bloomberg library within Qt creator.
                                Thanks a LOT for your help and patience, It is really good to have people like you to help people like me on this forum, especially because your also the one who guided me on my previous post, when I asked how to integrate the Bloomberg library... I thought this would be straight forward... :)
                                Cheers

                                1 Reply Last reply
                                0

                                1/15

                                23 Sept 2015, 11:25

                                • Login

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