[英]Using imported libraries in Qt
我已經使用導入了一個庫
LIBS += -Lhome/Integration/HelloSumit/DefaultComponent/DefaultConfig -aDefaultComponentA
在我的 Qt 項目中。 現在我想在 my.cpp 文件中使用它。 我怎么做? 我需要創建庫的 object 嗎?
閱讀問題評論,在.pro文件的HEADERS
部分中添加外部庫header不是go的方式。 (它指示 qmake 通過元對象編譯器運行 header。)而是添加
INCLUDEPATH += home/Integration/HelloSumit/DefaultComponent/DefaultConfig
到 your.pro 文件和
#include <MainDefaultComponent.h>
在 your.cpp 文件中訪問其中的聲明。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.