简体   繁体   English

如何在C ++ Qt Creator中使用库

[英]how to use a library in c++ Qt creator

I downloaded a library for processing DicOM FILES . 我下载了一个用于处理DicOM FILES的库。
The tree of library is : 图书馆的树是:

|--include
        |-----dicom.h
        |-----dicomcfg.h
|--lib
     |--------dicomsdl.lib

But I do not know how to use and built-in Qt Creator . 但是我不知道如何使用和内置Qt Creator。
If anyone can help me I will be very grateful. 如果有人可以帮助我,我将非常感激。

I'll assume you use qmake as your build system. 我假设您使用qmake作为构建系统。 To link your "external" library you need following changes in your .pro file: 要链接“外部”库,您需要在.pro文件中进行以下更改:

#path to includes directory of your library, qmake will try to find includes there
INCLUDEPATH += /path/to/library/include

#path to pre-compiled library directory
LIBS += -L/path/to/precomp/library

#link your pre-compiled library, -l<library name> w/o .so, .a, .lib, lib- prefix
LIBS += -ldicomsdl

Maybe you'll need to build the library from source with your compiler. 也许您需要使用编译器从源代码构建库。 There could be some troubles if compilers don't match. 如果编译器不匹配,可能会有一些麻烦。

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

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