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. How to use static link library in a new program?
Forum Updated to NodeBB v4.3 + New Features

How to use static link library in a new program?

Scheduled Pinned Locked Moved Solved General and Desktop
static linkingdll
3 Posts 2 Posters 1.6k 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.
  • M Offline
    M Offline
    MartinChan
    wrote on last edited by MartinChan
    #1

    Sorry as a rookie,I want to ask how to use a static link library in a new program.

    I have a DAQ Card(Data Acquisition Card),and it supplies three files for me to use:
    cbw.h
    cbw32.dll
    cbw32.lib

    I want to know how to configure rightly to use the function in it?Especially where to put these three files and how to change my .pro file.
    (I use Qt Creator and MSVC2015)

    raven-worxR 1 Reply Last reply
    0
    • M MartinChan

      Sorry as a rookie,I want to ask how to use a static link library in a new program.

      I have a DAQ Card(Data Acquisition Card),and it supplies three files for me to use:
      cbw.h
      cbw32.dll
      cbw32.lib

      I want to know how to configure rightly to use the function in it?Especially where to put these three files and how to change my .pro file.
      (I use Qt Creator and MSVC2015)

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @MartinChan
      read this
      Basically it's just adding the lib file to the LIB variable and add the INCLUDEPATH to the h-file.

      win32:LIBS += path/to/cbw32.lib
      INCLUDEPATH += path/to/dir-of-h-file
      

      btw. this isn't a static library, it's a dynamic library since you have also a dll file

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MartinChan
        wrote on last edited by
        #3

        Thx,and it is really simple to use add library guide to add in the .dll and .lib that I want.

        And what I found is that maybe most of situations didn't have a .dll file for debug mode(which you can simply tell from it if has a -d suffix),but you can use the given ones in a release mode.

        thx again.

        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