使用qt制作C++库

Erf*_*oli 0 c++ dll qt

我用qt creator构建了一个C++库.qt在debug文件夹3文件中为我构建:

'1. libSerialize.a' and '2. Serialize.dll' and 'serialize.o' .
Run Code Online (Sandbox Code Playgroud)

现在我想将这个库添加到另一个qt项目中.我怎样才能做到这一点?.我怎么能包括那个图书馆?.我应该在哪里复制那些?.哪一个是必要的?.这是我的.pro档案:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = get_send_array
TEMPLATE = app


SOURCES += main.cpp\
        widget.cpp \
    student.cpp

HEADERS  += widget.h \
    student.h
Run Code Online (Sandbox Code Playgroud)

谢谢,请帮助我.

mav*_*rik 5

使用:

win32:LIBS += /path/to/the/lib/Serialize.dll
unix:LIBS += -L/path/to/the/lib/ -lSerialize
Run Code Online (Sandbox Code Playgroud)

Serialize.dll是一个Windows动态加载库,它libSerialize.a是一个ar存档(您可以将其作为静态库),通常用于*nix系统.