Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Problems referencing libraries on W7

    General and Desktop
    qt 5.5 windows creator 3.4.2 visual studio 2
    3
    10
    2177
    Loading More Posts
    • 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.
    • T
      towtruck last edited by towtruck

      Hello All

      I could use some help getting my App to reference a library. Thanks in advance:

      First:
      OS: W7, 64bit
      Qt 5.5 for VS 2013 w/Creator 3.4.2
      Visual Studio 2013

      I created a library with VS2013 followig the pattern outlined here:
      https://msdn.microsoft.com/en-us/library/ms235627(v=vs.120).aspx

      Following Qt documetntation (http://doc.qt.io/qt-5/third-party-libraries.html), I added the following line to my *.pro file
      LIBS += -L"C:\Users\xxxxxxxx\Documents\CASES_PC\CPP\lib\static" -lVS_casesIO
      (the actual library name is VS_casesIO.lib)

      I ran Qmake. There were no errors or warning from this process that I could see.

      When I tried to run I got:
      prjpath.obj:-1: error: LNK2001: unresolved external symbol "public: __cdecl PrjFilePath::PrjFilePath(char const *)" (??0PrjFilePath@@QEAA@PEBD@Z)

      What am I doing wrong? Thanks to all.

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @towtruck last edited by

        @towtruck
        You need to add your static library to PRE_TARGETDEPS.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply Reply Quote 0
        • T
          towtruck last edited by towtruck

          I added

          PRE_TARGETDEPS += "C:\Users\xxxxxxxx\Documents\CASES_PC\CPP\lib\static\VS_casesIO.lib"

          to my project file and go the same results... (yes, I reran qmake)

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Hi,

            Maybe a silly question but, are you sure that the library and Qt are build for the same architecture ? 32 vs 64 bit.

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

            T 1 Reply Last reply Reply Quote 0
            • T
              towtruck @SGaist last edited by

              @SGaist
              Never really thought about it, but since I am using Qt for VS2015, and I used VS2015 to build the library, all on the same machine, I kinda figured it was all consistent. How do I check?

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Something's not clear here, in your first post you wrote that you where using Visual Studio 2013, did you change in between ?

                You can check the architecture in your project's settings or using a tool like Dependency Walker.

                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 Reply Quote 0
                • T
                  towtruck last edited by

                  My bad Vs2013 it is .
                  also,
                  It looks like the Qt build is 64 bit (From Projects | Build directory):
                  C:\Users\xxxxxxxx\Documents\build-cng12-Desktop_Qt_5_5_0_MSVC2013_64bit-Debug

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    Indeed it is. Therefore is VS_casesIO.lib also 64bit ?

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

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      towtruck @SGaist last edited by

                      @SGaist I sure expect so, but can;t figure out at the moment. Still a bit new to VS2013 as well...

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        Then get Dependency Walker, it will be faster. When the library is loaded there's a 64 icon if it's a 64 bit build.

                        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 Reply Quote 0
                        • First post
                          Last post