OSX在make上编译openalpr错误

时间:2016-03-08 07:22:27

标签: macos opencv openalpr

尝试为OSX编译openalpr,得到错误:

  

[62%]构建CXX对象   misc_utilities / CMakeFiles / openalpr-utils的-classifychars.dir / classifychars.cpp.o   /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:207:31:   错误:使用未声明的标识符'ENTER_KEY_ONE'             否则if(waitkey == ENTER_KEY_ONE || waitkey == ENTER_KEY_TWO)                                 ^ /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:207:59:   错误:使用未声明的标识符'ENTER_KEY_TWO'             否则if(waitkey == ENTER_KEY_ONE || waitkey == ENTER_KEY_TWO)                                                             ^ /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:340:21:   错误:使用未声明的标识符'ENTER_KEY_ONE'而(waitkey   != ENTER_KEY_ONE&& waitkey!= ENTER_KEY_TWO&& waitkey!= ESCAPE_KEY)                       ^ /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:340:49:   错误:使用未声明的标识符'ENTER_KEY_TWO'而(waitkey   != ENTER_KEY_ONE&& waitkey!= ENTER_KEY_TWO&& waitkey!= ESCAPE_KEY)                                                   ^ /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:367:29:   错误:使用未声明的标识符'ENTER_KEY_ONE'           waitkey =(int16_t)ENTER_KEY_ONE;                               ^ /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:380:18:   错误:使用未声明的标识符'ENTER_KEY_ONE'if(waitkey ==   ENTER_KEY_ONE || waitkey == ENTER_KEY_TWO)                    ^ /Users/dd/Documents/opencv/openalpr/src/misc_utilities/classifychars.cpp:380:46:   错误:使用未声明的标识符'ENTER_KEY_TWO'if(waitkey ==   ENTER_KEY_ONE || waitkey == ENTER_KEY_TWO)

     

生成了7个错误。 make [2]: *   [misc_utilities / CMakeFiles / openalpr-utils的-classifychars.dir / classifychars.cpp.o]   错误1 make [1]:*   [misc_utilities / CMakeFiles / openalpr-utils-classifychars.dir / all]错误   2 make:*** [all]错误2

10.10.5。 用于成功openalpr安装的brew: homebrew/science/openalpr: stable 2.2.0 (bottled), HEAD

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

好的,我可以在编辑到classifychars.cpp'后成功编译。似乎执行正常,所以这就是我所做的其他人遇到同样的问题。

以下是从第40行开始的原始代码块:

#ifdef __APPLE__
const int LEFT_ARROW_KEY = 2;
const int RIGHT_ARROW_KEY = 3;

const int DOWN_ARROW_KEY = 1;
const int UP_ARROW_KEY= 0;

#elif WIN32
const int LEFT_ARROW_KEY = 2424832;
const int RIGHT_ARROW_KEY = 2555904;

const int DOWN_ARROW_KEY = 2621440;
const int UP_ARROW_KEY = 2490368;

const int ENTER_KEY_ONE = 13;
const int ENTER_KEY_TWO = 10;

添加了2'未声明的标识符'在OSX部分:

#ifdef __APPLE__
const int LEFT_ARROW_KEY = 2;
const int RIGHT_ARROW_KEY = 3;

const int DOWN_ARROW_KEY = 1;
const int UP_ARROW_KEY= 0;

const int ENTER_KEY_ONE = 13;
const int ENTER_KEY_TWO = 10;

#elif WIN32
const int LEFT_ARROW_KEY = 2424832;
const int RIGHT_ARROW_KEY = 2555904;

const int DOWN_ARROW_KEY = 2621440;
const int UP_ARROW_KEY = 2490368;

const int ENTER_KEY_ONE = 13;
const int ENTER_KEY_TWO = 10;