如何在C ++ Qt Creator中使用库
how to use a library in c++ Qt creator
我下载了一个用于处理DicOM文件的库。
库的树是:
|--include
|-----dicom.h
|-----dicomcfg.h
|--lib
|--------dicomsdl.lib
但是我不知道如何使用和内置Qt Creator。
如果有人能帮助我,我将不胜感激。
我假设你使用 qmake 作为你的构建系统。要链接您的"外部"库,您需要在 .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
也许您需要使用编译器从源代码构建库。如果编译器不匹配,可能会有一些麻烦。
相关文章:
- 无法使用Qt Creator在Windows中构建yaml-cpp
- 在Qt Creator中,如何在连接到正在运行的进程后查看控制台输出
- 如何在QT Creator上将QWidget声明为继承类的对象
- 在 QTextEdit 中使用指针或在 Qt-Creator 上使用 connect()
- Qt creator 4.11,在应用程序输出面板中创建一个链接
- 使用 Cmake 在 Qt Creator 中显示头文件
- 如何在 CMakeLists.txt Qt Creator 中包含头文件?
- 为什么Qt Creator的应用程序输出不能从spdlog记录器打印
- 使用Qt Creator在调试模式下编译一段代码
- Qt Creator 在执行步骤 "make" 时出现编译错误,-fno-stack-limit
- Qt creator语言 - fno-elide-constructors 不起作用
- 如何将Valgrind与Qt Creator一起使用来调试远程应用程序?
- QT Creator将SQLite复制为空数据库
- 如何在QT Creator中手动运行CMake和Run
- 在Qt Creator中应用代码更改的快捷方式是什么?
- Qt Creator在linux mint 64位中找不到CMAKE_CXX_COMPILER编译器
- 为什么 qt-creator 在我用小写字母命名小部件类后无法构建?
- Qt Creator项目打破:"找不到建筑x86_64符号"
- 您将如何在现有的QT Creator GUI项目中实现ROS发布者和订阅者?
- 将OpenBLAS与Qt Creator项目链接