Qt 部署openvino时报错:too few arguments provided to function......


自我记录:首先在我VS2019上部署openvino已经成功,然后移植到Qt上,新建的.h和pp文件,直接copy的,但是包含头文件时却报错too few arguments provided to function......

问题原因:

问题出在openvino的interval.hpp文件中的

1 /// \brief The value used for no upper bound 2 static constexpr value_type s_max;

和windows.h中的

1 #ifndef max 2 #define max(a,b) (((a) > (b)) ? (a) : (b)) 3 #endif

宏定义冲突。

解决方法:

(失败)方法一:头文件include时顺序颠倒

1 #include <Windows.h> 2 #include "yolo_openvino.h" 3 *******改为****** 4 #include "yolo_openvino.h" 5 #include <Windows.h>

(失败)方法二:

把max前后用小括号括起来

1 static constexpr value_type s_max 2 ********************改为*********************** 3 static constexpr value_type s_max

(成功!)方法三:

所有引用 windows.h的地方:#include <windows.h>
换成 #include <qt_windows.h>

可以看到qt_windows.h里面已经对宏定义进行了修改



上一篇:Qt QModbusServer类

下一篇:Qt MSVC使用内存泄露检测工具 VLD(Visual Leak Detector)


Qt
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图