我在Ubuntu 11.10上将OpenCV 2.4与NetBeans 7.0.1一起使用。

当我尝试编译包含以下内容的代码时

CvSubdiv2DPoint* pt = cvSubdiv2DEdgeOrg( t );

我收到以下编译错误
error: there are no arguments to ‘cvSubdiv2DEdgeOrg’ that depend on a template parameter, so a declaration of ‘cvSubdiv2DEdgeOrg’ must be available [-fpermissive]
note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)

当我右键单击CvSubdiv2DPoint并选择Navigate:Got到声明/定义时,它在types_c.h中定义。如果据称是“未声明”的定义,我不明白该如何获得。另外,如果我包括
#include "types_c.h"

并确保types_c.h在包含路径中,我仍然收到上面的错误消息。

解决该问题的任何帮助将不胜感激,
彼得

最佳答案

它被移交给了传统。您需要包括其标题:

#include "opencv2/legacy/legacy.hpp"

关于opencv - OpenCV:Ubuntu:NetBeans:cvSubdiv2DEdgeOrg “undeclared”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10713344/

10-12 19:03