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. libtins
Forum Updated to NodeBB v4.3 + New Features

libtins

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 357 Views 1 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.
  • _ Offline
    _ Offline
    __d4ve__
    wrote on last edited by
    #1

    I have problem using libtins & Qt Creator

    I'm using libtins precompiled version 2015
    Trying to use it on the Qt Creator but I get error

    that's how my additional library file looks like:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++17
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp \
        workerobject.cpp
    
    HEADERS += \
        mainwindow.h \
        workerobject.h
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    DEFINES += HAVE_REMOTE
    DEFINES += WPCAP
    LIBS += WS2_32.lib
    
    
    win32: LIBS += -L$$PWD/'../../../../../../../../Program Files/Npcap/Lib/x64/' -lPacket
    
    INCLUDEPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
    DEPENDPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
    
    win32: LIBS += -L$$PWD/'../../../../../../../../Program Files/Npcap/Lib/x64/' -lwpcap
    
    INCLUDEPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
    DEPENDPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
    
    
    win32: LIBS += -L$$PWD/../../../../../../../../libtins/libtins-vs2015-x64-release/libtins/lib/ -ltins
    
    INCLUDEPATH += $$PWD/../../../../../../../../libtins/libtins-vs2015-x64-release/libtins/include
    DEPENDPATH += $$PWD/../../../../../../../../libtins/libtins-vs2015-x64-release/libtins/include
    

    The errors:

    mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Tins::NetworkInterface::NetworkInterface(void)" (__imp_??0NetworkInterface@Tins@@QEAA@XZ) referenced in function "public: __cdecl MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QEAA@PEAVQWidget@@@Z)
    
    \C++ Exercises\Qt Creator Projects\Project 1 - Network Packet GUI\GUI - Tin test\build-Gui_Tin_Test-Desktop_Qt_6_5_1_MSVC2019_64bit-Debug\debug\Gui_Tin_Test.exe:-1: error: LNK1120: 1 unresolved externals
    

    I followed the instruction on libtins github

    anyone here familiar with Qt Creator + libtins setup ?

    sierdzioS 1 Reply Last reply
    0
    • _ __d4ve__

      I have problem using libtins & Qt Creator

      I'm using libtins precompiled version 2015
      Trying to use it on the Qt Creator but I get error

      that's how my additional library file looks like:

      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++17
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
          main.cpp \
          mainwindow.cpp \
          workerobject.cpp
      
      HEADERS += \
          mainwindow.h \
          workerobject.h
      
      FORMS += \
          mainwindow.ui
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      DEFINES += HAVE_REMOTE
      DEFINES += WPCAP
      LIBS += WS2_32.lib
      
      
      win32: LIBS += -L$$PWD/'../../../../../../../../Program Files/Npcap/Lib/x64/' -lPacket
      
      INCLUDEPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
      DEPENDPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
      
      win32: LIBS += -L$$PWD/'../../../../../../../../Program Files/Npcap/Lib/x64/' -lwpcap
      
      INCLUDEPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
      DEPENDPATH += $$PWD/'../../../../../../../../Program Files/Npcap/Include'
      
      
      win32: LIBS += -L$$PWD/../../../../../../../../libtins/libtins-vs2015-x64-release/libtins/lib/ -ltins
      
      INCLUDEPATH += $$PWD/../../../../../../../../libtins/libtins-vs2015-x64-release/libtins/include
      DEPENDPATH += $$PWD/../../../../../../../../libtins/libtins-vs2015-x64-release/libtins/include
      

      The errors:

      mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Tins::NetworkInterface::NetworkInterface(void)" (__imp_??0NetworkInterface@Tins@@QEAA@XZ) referenced in function "public: __cdecl MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QEAA@PEAVQWidget@@@Z)
      
      \C++ Exercises\Qt Creator Projects\Project 1 - Network Packet GUI\GUI - Tin test\build-Gui_Tin_Test-Desktop_Qt_6_5_1_MSVC2019_64bit-Debug\debug\Gui_Tin_Test.exe:-1: error: LNK1120: 1 unresolved externals
      

      I followed the instruction on libtins github

      anyone here familiar with Qt Creator + libtins setup ?

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      MSVC 2015 and 2019 are not binary compatible. You likely need to recompile libtins with a newer compiler.

      (Z(:^

      _ 1 Reply Last reply
      3
      • sierdzioS sierdzio

        MSVC 2015 and 2019 are not binary compatible. You likely need to recompile libtins with a newer compiler.

        _ Offline
        _ Offline
        __d4ve__
        wrote on last edited by
        #3

        @sierdzio

        Compiled with Visual Studio 2022 but still bunch of errors

        82e95db1-5c59-45cf-bf61-d526568685fb-image.png

        sierdzioS 1 Reply Last reply
        0
        • _ __d4ve__

          @sierdzio

          Compiled with Visual Studio 2022 but still bunch of errors

          82e95db1-5c59-45cf-bf61-d526568685fb-image.png

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @__d4ve__ ok but what exactly is the error printed by the compiler or linker?

          (Z(:^

          1 Reply Last reply
          1

          • Login

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