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] Library inclusion problem
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Library inclusion problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • C Offline
    C Offline
    Clint Westwood
    wrote on last edited by Clint Westwood
    #1

    I'm using winpcap library in my project. The folder of this library resides inside my project folder (where my .pro file is). It works fine if I include this library in .pro file by writing full path like this:

    LIBS += "C:/.../.../.../.../.../My_project/WpdPack/Lib/wpcap.lib"
    

    However, I'm constantly going between several different machines. This forces me to edit path in .pro file each time I arrive to another PC. This is inconvenient, so I'd like to make it so qmake automatically searches for my libraries inside my project folder. All my attempts to do so have failed so far.

    I've tried this:

    LIBS += -L/My_project/WpdPack/Lib/ -lwpcap \
    

    but I get LNK1104 error in Windows compiler, telling me it can't open 'wpcap.lib'.

    I've also tried this and it failed with same error:

    INCLUDEPATH += $$PWD \
                   some_folder  \
                   another_folder  \
                   WpdPack/Include \
                   WpdPack/Lib
    
    LIBS += -lwpcap -lPacket
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      You should use $$PWD not just $PWD

      LIBS += -L$$PWD/WpdPack/lib
      

      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
      • C Offline
        C Offline
        Clint Westwood
        wrote on last edited by
        #3

        Thanks, it worked.

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

          You're welcome !

          Since it's working now, please mark the thread as solved so other forum users may know a solution has been found :)

          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

          • Login

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