无法在Mac上将Pylon(Basler)SDK与Qt链接 [英] Fail to link Pylon(Basler) SDK with Qt on Mac

查看:196
本文介绍了无法在Mac上将Pylon(Basler)SDK与Qt链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Qt与Qt Creator项目中的Pylon相机SDK链接.

I am trying to link Qt with the Pylon camera SDK in a Qt Creator project.

我从此用于OS X的pylon ,并且pylon框架安装在/Library/Frameworks/pylon.framework.

I install the pylon Camera Software Suite app from this pylon for OS X and the pylon framework is install at /Library/Frameworks/pylon.framework.

我首先遵循与应用程序一起安装的pylon Programmer's Guide,将塔架与Xcode链接起来.它完美地工作.

I first follow the pylon Programmer's Guide which is installed with the app to link the pylon with Xcode. It works perfectly.

然后,我尝试链接到我的Qt项目.我将此添加到.pro文件中:

Then I try to link with my Qt Project. I add this in the .pro file:

mac: LIBS += -F/Library/Frameworks/ -framework pylon

# add GenICam because pylon Programmer's Guide do so
INCLUDEPATH += /Library/Frameworks/pylon.framework/Headers/GenICam
DEPENDPATH += /Library/Frameworks

但这不起作用. Qt找不到头文件.

But this doesn't work. Qt cannot find the header files.

我也尝试:

QMAKE_LFLAGS += -F/Library/Frameworks/
LIBS += -framework pylon

如文档使用框架中所述.但仍然无法正常工作.有人帮我解决这个问题吗?谢谢.

as said in the document Using Frameworks. But still not working. Anyone help me to fix this? Thanks.

更新:

奇怪的是Qt可以检测到头文件的自动完成,但是在构建时却说找不到这样的文件.

Weird is that Qt can detect auto-complete of the header files but when build it says no such file found.

推荐答案

我刚刚回答了这个

A)如果您正在使用源代码编译此Pylon框架,则在这些情况下,您需要安装源代码,您需要转到 Pylon源目录,例如:

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/

您可以找到PylonIncludes.h的安装目录, 运行以下命令:

You can locate the directory where PylonIncludes.h is installed by runing the following command:

  find <path-to-Pylon> -name PylonIncludes.h

找到目录后,例如可以说 /Users/kevin/Pylon5.5,然后将以下行添加到您的 CMAkeLists.txt

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)如果您本身具有二进制框架,则可以通过将所有标头复制到pylon/<all-headers>

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上将Pylon(Basler)SDK与Qt链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆