问题描述
我试图添加pylon框架到Mac上的Qt creator。
QMAKE_LFLAGS + = -F / Library /框架/
LIBS + = -framework pylon
这对我不起作用。错误总是'pylon / PylonIncludes.h'文件未找到
。
我可以指定标题路径Qt创建者,例如 INCLUDEPATH + = /Library/Frameworks/pylon.framework/Versions/A/Headers
。但应该是 #include< PylonIncludes.h>
,而不是 #include< pylon / PylonIncludes.h>
然而,API标题都使用 #include< pylon / PylonIncludes.h> / code>,这意味着如果我想使用现有的API,我不能指定头的路径。
有人知道如何添加pylon框架到Qt
如果您正在使用source编译此Pylon框架,则
在这些情况下,您需要安装源代码,您需要转到Pylon源目录,例如:
< path-to-pylon> / src / include /
通过运行以下命令找到安装PylonIncludes.h的目录:
find< path-to-Pylon> -name PylonIncludes.h
让我们说/Users/kevin/Pylon5.5,然后在CMAkeLists.txt中添加以下行
INCLUDEPATH + = / Users / kevin / Pylon5.5 / src / include /
如果你有二进制框架本身,那么你可以通过将所有标题复制到临时位置 pylon /< all-headers>
cp -rf /Library/Frameworks/pylon.framework/Versions/A/Headers/* / tmp / pylonHeaders / pylon /
然后在.pro文件中使用以下内容
INCLUDEPATH + = / tmp / pylonHeaders
LIBS + = -framework pylon
I'm trying to add the pylon framework to Qt creator on Mac.
QMAKE_LFLAGS += -F/Library/Frameworks/
LIBS += -framework pylon
This doesn't work to me. The error is always 'pylon/PylonIncludes.h' file not found
.
I can specify the header path for Qt creator, e.g. INCLUDEPATH += /Library/Frameworks/pylon.framework/Versions/A/Headers
. But it should be #include <PylonIncludes.h>
, not #include <pylon/PylonIncludes.h>
when including the head file in code.
However, the API headers all use such form as #include <pylon/PylonIncludes.h>
, which means I cannot specify the path of header if I want to use the existing API.
Does anyone know how to add pylon framework to Qt creator?
解决方案 A) If you are compiling this Pylon framework with source then
In these cases you need source code installation, you need to go to your Pylon source directory, e.g.:
<path-to-pylon>/src/include/
You can locate the directory where PylonIncludes.h is installed by runing the following command:
find <path-to-Pylon> -name PylonIncludes.h
Once you locate the directory e.g. lets say /Users/kevin/Pylon5.5 then you include add the following line in your CMAkeLists.txt
INCLUDEPATH += /Users/kevin/Pylon5.5/src/include/
B) If you have binary framework itself then you can workaround by copying all headers to tmporary location under pylon/<all-headers>
cp -rf /Library/Frameworks/pylon.framework/Versions/A/Headers/* /tmp/pylonHeaders/pylon/
Then use following in .pro file
INCLUDEPATH += /tmp/pylonHeaders
LIBS += -framework pylon
这篇关于无法在Mac上的Qt创建者中链接pylon框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!