Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Getting LNK2019 error on plugin compilation

Getting LNK2019 error on plugin compilation

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
20 Posts 4 Posters 3.4k 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.
  • D Offline
    D Offline
    deleted456
    wrote on last edited by
    #3

    Hello @aha_1980 thanks a lot for your quick reply,
    As you mentioned i checked again my compilers and saw that i used Microsoft Visual C++ Compiler (MSVC) 12.0 (2013) as decleared in https://www.qcad.org/en/qcad-documentation/supported-platforms. You can see the compilers used in the picture.
    0_1548417141378_3.png
    my compiler
    0_1548417239306_4.png
    compiler used to build Qcad

    So im not sure if i got it correctly, did i used the same compiler with the one used to build QCad?

    Thanks a lot.

    aha_1980A 1 Reply Last reply
    0
    • D deleted456

      Hello @aha_1980 thanks a lot for your quick reply,
      As you mentioned i checked again my compilers and saw that i used Microsoft Visual C++ Compiler (MSVC) 12.0 (2013) as decleared in https://www.qcad.org/en/qcad-documentation/supported-platforms. You can see the compilers used in the picture.
      0_1548417141378_3.png
      my compiler
      0_1548417239306_4.png
      compiler used to build Qcad

      So im not sure if i got it correctly, did i used the same compiler with the one used to build QCad?

      Thanks a lot.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #4

      @wodasdsa So QCAD is build as 64bit version, so you need to build your plugin as 64 bit too.

      You'll need MSVC2013 64 bit (which you seem to have, the x86_amd64 version) and a suitable Qt version (can't tell that due to missing screenshot).

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      2
      • D Offline
        D Offline
        deleted456
        wrote on last edited by
        #5

        Greetings,
        I just uninstalled qt and compiler then installed it from https://download.qt.io/archive/qt/5.5/5.5.1/
        I tried installing "qt-opensource-windows-x86-msvc2013_64-5.5.1.exe" and while installing i selected msvc2013_64 bit and installed Qt5.5 and msvc2013. On the kits panel i can see that Mscv2013_64 bit is installed but compiler shows 32bit version.

        2_1548593731602_7.png 1_1548593731602_6.png 0_1548593731601_5.png

        While building the plugin, I still get the error message i got in the previous version. And i'm not sure the issue is based on using different bit versions. There is no 64bit qt installer on https://download.qt.io/archive/qt/5.5/5.5.1/ and i can see that qt is compiled with
        Architecture: x86_64 (the last pic from my previous post).

        Could you please try to build the plugin by using your own qt and compiler and let me know about the specs? Cause im pretty sure that i installed the 64bit version of msvc2013 and respective sdk.

        Apologies for taking your time and thanks a lot.

        aha_1980A 1 Reply Last reply
        0
        • D deleted456

          Greetings,
          I just uninstalled qt and compiler then installed it from https://download.qt.io/archive/qt/5.5/5.5.1/
          I tried installing "qt-opensource-windows-x86-msvc2013_64-5.5.1.exe" and while installing i selected msvc2013_64 bit and installed Qt5.5 and msvc2013. On the kits panel i can see that Mscv2013_64 bit is installed but compiler shows 32bit version.

          2_1548593731602_7.png 1_1548593731602_6.png 0_1548593731601_5.png

          While building the plugin, I still get the error message i got in the previous version. And i'm not sure the issue is based on using different bit versions. There is no 64bit qt installer on https://download.qt.io/archive/qt/5.5/5.5.1/ and i can see that qt is compiled with
          Architecture: x86_64 (the last pic from my previous post).

          Could you please try to build the plugin by using your own qt and compiler and let me know about the specs? Cause im pretty sure that i installed the 64bit version of msvc2013 and respective sdk.

          Apologies for taking your time and thanks a lot.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @wodasdsa

          Please show screenshots of you Kits (click on Desktop 5.5.1 ... resp. Desktop (default)) to see how the Kits are set up.

          Could you please try to build the plugin by using your own qt and compiler

          Unfortunately, no. I neither have Windows nor MSVC :)

          Qt has to stay free or it will die.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deleted456
            wrote on last edited by
            #7

            Here you can see the information about kits,
            0_1548595843415_3.png

            Do you think these errors are based on using different bit versions? (btw i dont get the error and compile succesfully if i erase getPluginInfo() method from Reaxmpleplugin.cpp file (as i explained in my very first post)

            0_1548595903865_3.png

            Unfortunately, no. I neither have Windows nor MSVC :)

            Oh okey thanks a lot anyways..

            1 Reply Last reply
            0
            • D Offline
              D Offline
              deleted456
              wrote on last edited by
              #8

              and the manual desktop (default) panel,

              0_1548596188432_4.png

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deleted456
                wrote on last edited by
                #9

                any update?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  Hi,

                  From the looks of it, you don't export any symbol from your library. This means that, on Windows, the linker won't find them.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    deleted456
                    wrote on last edited by deleted456
                    #11

                    @SGaist said in Getting LNK2019 error on plugin compilation:

                    This means that, on Windows, the linker won't find them.

                    Hello thanks for you answer, to be honest im quite newbie to qt and im not exactly got what you have suggested. You mean the compiler doesnt found qcadcore.lib,qcadgui.lib and qcadecmaapi.lib files in exampleplugin.pro file? And if so how can i solve it?
                    Thanks a lot for your help

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by SGaist
                      #12

                      Did yes, they want to see on them.

                      It's rather that they are not generated because no symbol were exported.

                      [edit: Something went wrong with the answer SGaist]

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        deleted456
                        wrote on last edited by
                        #13

                        Sorry what do you mean?

                        I had .dll files from source code and used this method https://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/ to create .lib files

                        jsulmJ 1 Reply Last reply
                        0
                        • D deleted456

                          Sorry what do you mean?

                          I had .dll files from source code and used this method https://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/ to create .lib files

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #14

                          @wodasdsa You should read http://doc.qt.io/qt-5/sharedlibrary.html

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

                          1 Reply Last reply
                          1
                          • D Offline
                            D Offline
                            deleted456
                            wrote on last edited by
                            #15

                            i dont think the problem is in libraries i cant compile without them either..

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #16

                              Can you show the relevant header(s) content ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                deleted456
                                wrote on last edited by
                                #17

                                Sure,1_1549019333195_02.png 0_1549019333194_01.png
                                to see shared.pri you can check the following link,
                                https://github.com/qcad/qcad/blob/master/shared.pri

                                Thanks

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #18

                                  You're on Windows and not exporting any symbol hence the problem. Do as @jsulm suggested and use the export macros.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  1
                                  • D Offline
                                    D Offline
                                    deleted456
                                    wrote on last edited by
                                    #19

                                    How can i do that? im newbie to qt and didnt understand most the terms used in that documentation..

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #20

                                      Just follow the indications in the "Using Symbols from Shared Libraries" part.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      1

                                      • Login

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