简体   繁体   English

用qt制作C ++库

[英]make C++ Library with qt

i build a C++ library with qt creator. 我用Qt Creator建立了一个C ++库。 qt builds for me in debug folder 3 files: qt在调试文件夹3个文件中为我构建:

 '1. libSerialize.a' and '2. Serialize.dll' and 'serialize.o' . 

now i want to add this library to another qt project. 现在我想将此库添加到另一个qt项目。 how can i do that?. 我怎样才能做到这一点?。 how can i include that library? 我如何包含该库? . where should i copy those? 我应该在哪里复制这些? . which one is necessary? 哪一个是必要的? . this is my .pro file: 这是我的.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

so thanks, please help me. 所以谢谢,请帮助我。

Use: 采用:

win32:LIBS += /path/to/the/lib/Serialize.dll
unix:LIBS += -L/path/to/the/lib/ -lSerialize

Serialize.dll is a windows dynamic load library, and libSerialize.a is an ar archive (you may reffer to it as a static library) and usually used in *nix systems. Serialize.dll是Windows动态加载库, libSerialize.aar归档文件(您可以将其称为静态库),通常在* nix系统中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM