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. Link Qt libraries to MFC project. Link error
Forum Updated to NodeBB v4.3 + New Features

Link Qt libraries to MFC project. Link error

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 972 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.
  • mandruk1331M Offline
    mandruk1331M Offline
    mandruk1331
    wrote on last edited by
    #1

    Hello
    I have created a simple message box in MFC using the Qt function which was linked in code. Now I want to link all the libraries to MFC project in order to replace the MFC UI with the Qt ui. At the moment I receive a lot of link errors and one of them is:

    Error	1	error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ) referenced in function _showDialog
    

    In VS I linked headers, dll and libs but the problem is still present. I'm sure that I missed something. Can you help me out? Thank you in advance.

    Mandruk1331

    jsulmJ 1 Reply Last reply
    0
    • mandruk1331M mandruk1331

      Hello
      I have created a simple message box in MFC using the Qt function which was linked in code. Now I want to link all the libraries to MFC project in order to replace the MFC UI with the Qt ui. At the moment I receive a lot of link errors and one of them is:

      Error	1	error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ) referenced in function _showDialog
      

      In VS I linked headers, dll and libs but the problem is still present. I'm sure that I missed something. Can you help me out? Thank you in advance.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mandruk1331 Are the Qt libraries you're using built with same compiler as you're using for the project?
      You either don't link correctly against Qt libs or your Qt libs are built using different compiler.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • mandruk1331M Offline
        mandruk1331M Offline
        mandruk1331
        wrote on last edited by
        #3

        0_1508939454065_fb506064-814c-4ee5-8473-5f10eac3688c-image.png

        this is how I included everything in VS13. I have to fully build Qt for VS?

        Mandruk1331

        jsulmJ 1 Reply Last reply
        0
        • mandruk1331M mandruk1331

          0_1508939454065_fb506064-814c-4ee5-8473-5f10eac3688c-image.png

          this is how I included everything in VS13. I have to fully build Qt for VS?

          jsulmJ Online
          jsulmJ Online
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @mandruk1331 You need to check the compiler output to see which paths are passed to the linker. Also do you build your project as 64bit or32bit?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          mandruk1331M 1 Reply Last reply
          0
          • jsulmJ jsulm

            @mandruk1331 You need to check the compiler output to see which paths are passed to the linker. Also do you build your project as 64bit or32bit?

            mandruk1331M Offline
            mandruk1331M Offline
            mandruk1331
            wrote on last edited by
            #5

            @jsulm checked the logs VS includes the headers and sets the lib and bin path but there is no operation in including the libs or dll.
            32bit

            Mandruk1331

            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