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 5.02 won't build with MSVC2012
QtWS25 Last Chance

Qt 5.02 won't build with MSVC2012

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 2 Posters 2.8k 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.
  • C Offline
    C Offline
    Compizfox
    wrote on last edited by
    #1

    Hi all,

    I'm trying to do a static build of Qt 5.0.2 using MSVC2012. However, I'm getting the following error:

    @ Creating library D:\Qt\qt-everywhere-opensource-src-5.0.2\x86_64\qtbase\bin\q
    mlscene.lib and object D:\Qt\qt-everywhere-opensource-src-5.0.2\x86_64\qtbase\bi
    n\qmlscene.exp
    Qt5Quick.lib(qquickshadereffectsource.obj) : error LNK2001: unresolved external
    symbol __imp_glBindTexture
    Qt5Gui.lib(qopenglpaintengine.obj) : error LNK2001: unresolved external symbol _
    _imp_glStencilOpSeparate
    D:\Qt\qt-everywhere-opensource-src-5.0.2\x86_64\qtbase\bin\qmlscene.exe : fatal
    error LNK1120: 100 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
    \VC\BIN\x86_amd64\link.EXE"' : return code '0x460'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
    \VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    @

    (shortened, output was too large to fit into post, see full output at http://pastebin.com/m0dMRgnF)
    I can't find anything about it. Is this a bug?

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

      Not a bug -- the compiler just can't find your OpenGL libraries.

      What are your 'configure' options?

      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
        Compizfox
        wrote on last edited by
        #3

        Thanks for your reply!

        These are my configure options:
        @..\configure -nomake tests -nomake examples -no-openssl -no-rtti -release -static -platform win32-msvc2012 -mp -ltcg@

        The wiki says the following about OpenGL:

        bq. A copy of ANGLE is bundled in Qt 5. To use Option 1, you need to install the DirectX SDK [msdn.microsoft.com] (Note: Starting from Windows Kit 8, this is included in the Windows SDK).

        http://qt-project.org/wiki/Building_Qt_5_from_Git#aea23489ce3aa9b6406ebb28e0cda430

        I did install the Windows SDK 8, so I should have the DirectX SDK.

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

          Hmm... I don't know the answer for sure (I only have experience with dynamic builds, not static ones), but here are some things you can try (clean out your build tree before reconfiguring):

          • "This page":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html#building-qt-statically says to call "nmake sub-src" instead of just "nmake" for static builds
          • I've read that "-no-rtti" has caused problems for people before; try removing that option
          • You don't need to specify "-platform win32-msvc2012" because Qt should auto-detect it
          • Instead of typing "..\configure", try going up one level and typing just "configure"

          If none of those work, you'll have to wait for someone else to come and help you, sorry!

          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
            Compizfox
            wrote on last edited by
            #5

            bq. This page [qt-project.org] says to call “nmake sub-src” instead of just “nmake” for static builds

            • http://qtnode.net/wiki/Building_static says nmake sub-src will not build examples and demo's. Apparently that's the only difference with nmake, so it has nothing to do with static builds :)
              I already excluded those with the configure options -nomake tests -nomake examples.

            bq. I’ve read that “-no-rtti” has caused problems for people before; try removing that option

            • I reconfigured it with -opengl desktop, so I'm compiling again now. We'll see if this succeeds. If it doesn't, I'll try without -no-rtti :)

            bq. You don’t need to specify “-platform win32-msvc2012” because Qt should auto-detect it

            • How could it possibly auto-detect that? I mean, in the case that I have msvc2010, msvc2012 and MinGW installed on my build environment at the same time (which is totally valid), how does the build script know what compiler I want to use?

            bq. Instead of typing “..\configure”, try going up one level and typing just “configure”

            • I'm using this because I want my build to be in a subfolder (qt-everywhere-opensource-src-5.0.2\x86_64). After the x86_64 I'm gonna compile a x86 version too, in qt-everywhere-opensource-src-5.0.2\x86. That's why ;)
              Otherwise I would have to duplicate the whole source.
            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              [quote author="Compizfox" date="1372387383"]* http://qtnode.net/wiki/Building_static says nmake sub-src will not build examples and demo's. Apparently that's the only difference with nmake, so it has nothing to do with static builds :)
              I already excluded those with the configure options -nomake tests -nomake examples.[/quote]Ah, you're right :)

              [quote]bq. You don’t need to specify “-platform win32-msvc2012” because Qt should auto-detect it

              • How could it possibly auto-detect that? I mean, in the case that I have msvc2010, msvc2012 and MinGW installed on my build environment at the same time (which is totally valid), how does the build script know what compiler I want to use?[/quote]Hmm... I wouldn't put multiple tool chains in my environment, especially if they're different versions of the same tools. Even if you tell the script which compiler to use, your compiler could end up invoking the wrong version of another tool with the same name, unless Microsoft has programmed their tools to look in particular places all the time and ignore the environment variables.

              That's why your Visual Studio installation comes with a Command Prompt shortcut -- Instead of exposing the tools to the global environment, the shortcut sets up a temporary isolated environment within that shell, to reduce the risk of invoking wrong tools.

              [quote]bq. Instead of typing “..\configure”, try going up one level and typing just “configure”

              • I'm using this because I want my build to be in a subfolder (qt-everywhere-opensource-src-5.0.2\x86_64). After the x86_64 I'm gonna compile a x86 version too, in qt-everywhere-opensource-src-5.0.2\x86. That's why ;)
                Otherwise I would have to duplicate the whole source.[/quote]The official way to do that is to use the -prefix configure option, if I'm not mistaken. I haven't seen this method before, but it looks like a convenient alternative if it works.

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

              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