iOS中使用opencv碰到这样的编译错误:non-const static data member must be initialized out of line

来源:互联网 发布:淘宝企业店铺可以改吗 编辑:程序博客网 时间:2024/05/04 00:05

The issue seems to be an interference with the default MIN(a,b) macro in one of the iOS  frameworks.

Got it working by modifying the following files:

OpenCV-2.2.0/modules/core/include/opencv2/core/core.hpp OpenCV-2.2.0/modules/core/include/opencv2/core/operations.hpp

The modification involved creating another MIN macro in both files, I called it __MIN(a,b):

#define __MIN(a,b) ((a)<(b)?(a):(b))

and replacing all MIN(...) calls with __MIN(...).

After the changes opencv compiles without errors.

原创粉丝点击