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. Problems referencing libraries on W7
Forum Updated to NodeBB v4.3 + New Features

Problems referencing libraries on W7

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 5.5 windowscreator 3.4.2visual studio 2
10 Posts 3 Posters 2.8k Views 2 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.
  • T Offline
    T Offline
    towtruck
    wrote on 14 Jan 2016, 19:01 last edited by towtruck
    #1

    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.

    K 1 Reply Last reply 14 Jan 2016, 19:14
    0
    • T towtruck
      14 Jan 2016, 19:01

      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.

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 14 Jan 2016, 19:14 last edited by
      #2

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

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        towtruck
        wrote on 14 Jan 2016, 21:07 last edited by towtruck
        #3

        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
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Jan 2016, 22:34 last edited by
          #4

          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 14 Jan 2016, 23:12
          0
          • S SGaist
            14 Jan 2016, 22:34

            Hi,

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

            T Offline
            T Offline
            towtruck
            wrote on 14 Jan 2016, 23:12 last edited by
            #5

            @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
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 14 Jan 2016, 23:16 last edited by
              #6

              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
              0
              • T Offline
                T Offline
                towtruck
                wrote on 14 Jan 2016, 23:21 last edited by
                #7

                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
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 14 Jan 2016, 23:26 last edited by
                  #8

                  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 14 Jan 2016, 23:43
                  0
                  • S SGaist
                    14 Jan 2016, 23:26

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

                    T Offline
                    T Offline
                    towtruck
                    wrote on 14 Jan 2016, 23:43 last edited by
                    #9

                    @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
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 14 Jan 2016, 23:46 last edited by
                      #10

                      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
                      0

                      3/10

                      14 Jan 2016, 21:07

                      topic:navigator.unread, 7
                      • Login

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