Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. LNK1104 after adding custom libaries
QtWS25 Last Chance

LNK1104 after adding custom libaries

Scheduled Pinned Locked Moved Solved Installation and Deployment
librarieslnk1104
3 Posts 2 Posters 1.5k 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.
  • T Offline
    T Offline
    TKowalski
    wrote on last edited by TKowalski
    #1

    Hi everyone

    I'm pretty new to the whole Qt thing, but everything seems to be okay for me, besides this one. In my project, I need to use two third party libraries: RapidJSON and TinyXML2.

    I downloaded their code on GitHub, and compiled them using MingW (using g++ -o tinyxml2.o tinyxml2.h and then ar rcs libtinyxml2.a tinyxml2.o). After, I just added the library to my project, using Qt Creator, and tried to compile.
    But I can't. I get a LNK1104 error from the compiler: "can't open file 'tinyxml2d.lib'". After restarting, I also have this now :

    :-1: erreur : dependent 'D:\Users\thoma\Documents\TEST\C:\Libs\tinyxml2d.lib' does not exist.

    I mean, it's kind of normal it can find it since I only have .a and not .lib files. What am I missing ?

    I'm using Windows 10 (x64).

    Thanks

    By the way, here is my .pro file.

    EDIT : I tried to remove the various $$PWD/ from the .pro file, and I'm getting the first error message again.

    kshegunovK 1 Reply Last reply
    0
    • T TKowalski

      Hi everyone

      I'm pretty new to the whole Qt thing, but everything seems to be okay for me, besides this one. In my project, I need to use two third party libraries: RapidJSON and TinyXML2.

      I downloaded their code on GitHub, and compiled them using MingW (using g++ -o tinyxml2.o tinyxml2.h and then ar rcs libtinyxml2.a tinyxml2.o). After, I just added the library to my project, using Qt Creator, and tried to compile.
      But I can't. I get a LNK1104 error from the compiler: "can't open file 'tinyxml2d.lib'". After restarting, I also have this now :

      :-1: erreur : dependent 'D:\Users\thoma\Documents\TEST\C:\Libs\tinyxml2d.lib' does not exist.

      I mean, it's kind of normal it can find it since I only have .a and not .lib files. What am I missing ?

      I'm using Windows 10 (x64).

      Thanks

      By the way, here is my .pro file.

      EDIT : I tried to remove the various $$PWD/ from the .pro file, and I'm getting the first error message again.

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

      Hello Thomas,
      Welcome to the Qt forum!

      @TKowalski said in LNK1104 after adding custom libaries:

      I need to use two third party libraries: RapidJSON and TinyXML2.

      Qt provides support for both JSON and XML from the QtCore module.

      win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/C:/Libs/libtinyxml2.a
      else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/C:/Libs/libtinyxml2d.a
      else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/C:/Libs/tinyxml2.lib
      else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/C:/Libs/tinyxml2d.lib
      

      This assumes you're linking static libraries. Furthermore mingw (win32-g++) doesn't generate lib files, but archives - .a, because it's a port of Linux's g++ ... and based on this pro file I'd say you're compiling your project with MSVC (the error code/formatting is also a giveaway). You can't mix compilers! Either compile everything with MSVC or with mingw.

      Kind regards.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1
      • T Offline
        T Offline
        TKowalski
        wrote on last edited by
        #3

        I guess I'll just use the Qt's implementations then. Thanks for the explanation though.

        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