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. Unresolved external symbols when building empty QT project
Forum Updated to NodeBB v4.3 + New Features

Unresolved external symbols when building empty QT project

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 2 Posters 5.2k Views 1 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.
  • A Offline
    A Offline
    Amomum
    wrote on 23 Apr 2014, 11:45 last edited by
    #1

    I have installed Visual Studio 2010, Windows SDK and Qt 5.2.1.
    I created an empty qt widgets application project with Qt Creator but it doesn't build, giving me numerous linking errors:

    @MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__EncodePointer@4 referenced in function _pre_c_init
    MSVCRTD.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp__EncodePointer@4@

    and so on.

    I also tried rebuilding some examples - and they gave different error:

    @c:\qt\qt5.2.1\5.2.1\src\qtbase\include\qtcore../../src/corelib/global/qt_windows.h(71) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory@

    I have no clue what to do, I tried adding paths to windows.h in PATH and INCLUDE system variables (with no success).

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 23 Apr 2014, 12:11 last edited by
      #2

      Which Qt package have you installed?

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Amomum
        wrote on 23 Apr 2014, 13:31 last edited by
        #3

        Qt 5.2.1 for Windows 32-bit (VS 2010, OpenGL)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 23 Apr 2014, 14:30 last edited by
          #4

          That looks correct. I see 2 possibilities:

          Kit setup in Qt Creator is wrong: please check this (Qt Creator->Tools->Preferences->Build & Run->Kits)

          Another compiler was installed by Windows SDK and it is not compatible with MSVC 2010. In that case, uninstall Windows SDK (you do not need it anyway...)

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Amomum
            wrote on 23 Apr 2014, 14:48 last edited by
            #5
            1. In Kit setup i see two kits:
            • auto-detected "Desktop Qt 5.2.1 MSVC2010 32bit OpenGL" - chosen as default
            • manual "Qt 5.2.1 (Src)"

            Build fails with both of them.

            1. I'm afraid I need windows sdk (more precise - directx sdk, which is now part of windows sdk, if I'm correct). What should I do?
            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 23 Apr 2014, 14:58 last edited by
              #6

              Please verify that the compiler shipped in your SDK is also MSVC 2010. If it is any other version, you will need Qt for that version, too.

              (Z(:^

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Amomum
                wrote on 23 Apr 2014, 15:03 last edited by
                #7

                Why does compiler in SDK matter at all? In build & run ->compilers I can see only three compilers from MSVC 2010 (x86, amd64 and ia64) from correct paths.
                I am compiling with that compiler.. am I not?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sierdzio
                  Moderators
                  wrote on 23 Apr 2014, 15:09 last edited by
                  #8

                  Right, ok, you probably are ;)

                  I keep talking about the SDK because it seems to be the only thing that can interfere here. I know that MSVC 2010 itself works well and without problems, and is being actively used by many people.

                  (Z(:^

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Amomum
                    wrote on 23 Apr 2014, 15:37 last edited by
                    #9

                    Riight.. I uninstalled windows SDK. Example still doesn't build with the same error, but empty project now gives:
                    @
                    LINK : fatal error LNK1104: cannot open file 'glu32.lib'@

                    According to "this thread":http://qt-project.org/forums/viewthread/30006 windows SDK is neccessary for Qt with opengl :)

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      sierdzio
                      Moderators
                      wrote on 23 Apr 2014, 15:47 last edited by
                      #10

                      I would imagine only a good driver is needed (nVidia/ AMD/ Intel). But you may be right. I am not too intimate with development on Windows.

                      (Z(:^

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        Amomum
                        wrote on 23 Apr 2014, 15:50 last edited by
                        #11

                        Riiight, so.. what should I do?

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Amomum
                          wrote on 24 Apr 2014, 15:48 last edited by
                          #12

                          I found a suitable workaround in using MiniGW instead of MCVS.

                          1 Reply Last reply
                          0

                          1/12

                          23 Apr 2014, 11:45

                          • Login

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