1.建立qt项目;
2.在pro文件最后面添加:
win32: LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
a
l
c
o
n
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhalcon LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhalconLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhalconc
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
a
l
c
o
n
c
p
p
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhalconcpp LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhalconcppLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhalconcppxl
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
a
l
c
o
n
c
x
l
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhalconcxl LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhalconcxlLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhalconxl
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
d
e
v
e
n
g
i
n
e
c
p
p
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhdevenginecpp LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhdevenginecppLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhalconx
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
a
l
c
o
n
c
p
p
10
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhalconcpp10 LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhalconcpp10LIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhalconcpp10xl
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
a
l
c
o
n
x
x
l
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhalconxxl LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhalconxxlLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhdevenginecpp10
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
d
e
v
e
n
g
i
n
e
c
p
p
10
x
l
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhdevenginecpp10xl LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhdevenginecpp10xlLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhdevenginecppxl
LIBS += -L
P
W
D
/
.
.
/
.
.
/
.
.
/
A
P
P
/
h
a
l
/
l
i
b
/
x
64
−
w
i
n
64
/
−
l
h
d
e
v
e
n
g
i
n
e
x
L
I
B
S
+
=
−
L
PWD/../../../APP/hal/lib/x64-win64/ -lhdevenginex LIBS += -L
PWD/../../../APP/hal/lib/x64−win64/−lhdevenginexLIBS+=−LPWD/…/…/…/APP/hal/lib/x64-win64/ -lhdevenginexxl
注:这里的APP/hal/lib/x64-win64是你的halcon相对应的安装目录。
INCLUDEPATH += D:/APP/hal/include
D:/APP/hal/include/halconcpp
DEPENDPATH += $$PWD/…/…/…/APP/hal/lib/x64-win64
3.在所需要的地方如“.h文件”和“.cpp文件”添加:
#include “Halcon.h”
#include “HalconCpp.h”
完成上述步骤即可进行halcon与qt的联合编程。