自我记录:首先在我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 QList使用总结
Qt









