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. [SOLVED] Problem adding an external library to QtCreator

[SOLVED] Problem adding an external library to QtCreator

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.3k 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.
  • B Offline
    B Offline
    blueblood
    wrote on last edited by
    #1

    Hi there,

    I have those 2 lines in my .pro file :

    @INCLUDEPATH += C:/Users/username/Downloads/Compressed/id3lib-3.8.3/id3lib-3.8.3/include

    LIBS += LC:/Users/username/Downloads/Compressed/id3lib-3.8.3binaries/id3lib-3.8.3binaries/Debug -lid3lib
    @

    The includes are found all right with auto-completion. When linking, I get this:

    LNK1104: cannot open file 'C:/Users/userame/Downloads/Compressed/id3lib-3.8.3binaries/id3lib-3.8.3binaries/Debug.obj'

    I have no idea what QtCreator is after here.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tilsitt
      wrote on last edited by
      #2

      Hi,

      your LIBS line miss a '-' in front of 'L':

      @
      LIBS += -LC:/Users/username/Downloads/Compressed/id3lib-3.8.3binaries/id3lib-3.8.3binaries/Debug -lid3lib
      @

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blueblood
        wrote on last edited by
        #3

        thanks.

        I applied the dash as suggested and now I get unresolved externals for all the library methods I use.

        Example:

        LNK2019: unresolved external symbol "public: class ID3_Field * __cdecl ID3_Frame::GetField(enum ID3_FieldID)const " (?GetField@ID3_Frame@@QEBAPEAVID3_Field@@W4ID3_FieldID@@@Z) referenced in function "private: char const * __cdecl Song::_fieldNameFromFrame(class std::shared_ptr<class ID3_Frame>)const " (?_fieldNameFromFrame@Song@@AEBAPEBDV?$shared_ptr@VID3_Frame@@@std@@@Z)

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tilsitt
          wrote on last edited by
          #4

          Ok, now it's not about Qt anymore. The compiler says it: your lib doesn't contain the symbols. I guess C:/Users/username/Downloads/Compressed/id3lib-3.8.3binaries/id3lib-3.8.3binaries/Debug contains a file called id3lib.lib? Did you compile it yourself? Is it a static or shared library?

          1 Reply Last reply
          0
          • B Offline
            B Offline
            blueblood
            wrote on last edited by
            #5

            Thanks. It contains that file, and I didn't compile it myself, I downloaded it. I'm trying to link it statically using this preprocessor directive:

            ID3LIB_LINKOPTION=1

            1 Reply Last reply
            0
            • B Offline
              B Offline
              blueblood
              wrote on last edited by
              #6

              I don't know, but the same method calls from id3lib in visual studio work just fine. The problem is, I can't find the visual studio addin installer anymore, to develop in VS instead.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                blueblood
                wrote on last edited by
                #7

                So I installed the "Visual Studio addin":http://ftp.fau.de/qtproject/official_releases/vsaddin/qt-vs-addin-1.2.3-opensource.exe, which highlighted that I was using 64-bit Qt for a 32-bit build:

                module machine type 'x64' conflicts with target machine type 'X86' ...\Qt5Cored.lib(Qt5Cored.dll).

                So I downloaded the 32-bit Qt and rebuilt and it seems to compile fine.

                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