Halcon + Qt 配置(ubuntu 16.04)

23 篇文章 3 订阅
13 篇文章 0 订阅

1. 方式一

  • 在 Qt 项目名称上右键,选择 Add Library,弹出以下界面,手动选择 Library file和 Include path

  • 配置完成后,.pro文件相关内容如下:
LIBS += -lX11

unix:!macx:
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhalcon
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhalconc
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhalconcpp
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhalconcppxl
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhalconcxl
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhalconxl
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhdevenginecpp
LIBS += -L$$PWD/../../../../../../../../opt/halcon/lib/x64-linux/ -lhdevenginecppxl

INCLUDEPATH += $$PWD/../../../../../../../../opt/halcon/include
INCLUDEPATH += $$PWD/../../../../../../../../opt/halcon/include/halconcpp
DEPENDPATH += $$PWD/../../../../../../../../opt/halcon/include
  • 后面使用的时候直接 copy 过去即可。

2. 方式二

将 halcon 添加到环境变量,在 ~/.bashrc中添加如下内容:

HALCONARCH=x64-linux; export HALCONARCH
HALCONROOT=/opt/halcon; export HALCONROOT
HALCONEXAMPLES=${HALCONROOT}/examples; export HALCONEXAMPLES
HALCONIMAGES=${HALCONROOT}/examples/images; export HALCONIMAGES
PATH=${HALCONROOT}/bin/${HALCONARCH}:${HALCONROOT}/FLEXlm/${HALCONARCH}:${PATH}
export PATH
if [ ${LD_LIBRARY_PATH} ] ; then
LD_LIBRARY_PATH=${HALCONROOT}/lib/${HALCONARCH}:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=${HALCONROOT}/lib/${HALCONARCH}; export LD_LIBRARY_PATH
fi
if [ "x${FLEXID_LIBRARY_PATH}" = "x" ]; then
FLEXID_LIBRARY_PATH="${HALCONROOT}/FLEXlm/${HALCONARCH}/flexid9:/usr/lib"
export FLEXID_LIBRARY_PATH
fi

.pro文件中直接配置:

INCLUDEPATH += "$HALCONROOT/include"
INCLUDEPATH += "$HALCONROOT/include/halconcpp"

unix:LIBS += -lhalcon -halconcpp -lX11

转载:Halcon + Qt 配置(ubuntu 16.04) - 知乎 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值