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

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.

你可能感兴趣的:(OpenCV,iPhone开发)