Open cv 2.4 - opencv_java build error -

asked 2016-07-19 23:47:21 -0500

tacocat88 gravatar image

updated 2016-07-20 02:44:39 -0500

Visual Studio reports under build of open cv: class % (%s) is duplicated" %\ and says there's an syntax error.

The error pertains to the file in \opencv\modules\java\generator\

The error message indicates that line 813 in said file is the culprit. Line 813 reads:

Def add_class(self, decl):

classinfo = Classinfo(decl)

if in class_ignore_list:


name =

if name in self.classes:

print "Generator error: class %s (%s) is duplicated" %\

(name, classinfo.cname)


the same file in Opencv 3.1.0 in same class, line 959 (I'm using notepad++) reads:

Def add_class(self, decl): ...

self.classes[name] = classinfo

if name in type dict:

logging.warning('duplicated: %s' , classinfo)


Apparantly calls to the print method in Python needs to be enclosed in parethesis thusly: print("some msg"). Original code called print only by: " some msg". It created the error messages.

edit retag flag offensive close merge delete


can you give us the exact error msg ? (which class is duplicated, and where 's the syntax err ?)

berak gravatar imageberak ( 2016-07-20 00:20:27 -0500 )edit

That IS the exact error message. The syntax error is at line 813 in in the class add_class.

tacocat88 gravatar imagetacocat88 ( 2016-07-20 00:23:58 -0500 )edit

Line 34, visual studio:Generating core.cpp

Line 34, visual studio: File "c:/users/.../, line 813

CUSTOMBUILD : print Generator error : class %s (%s) is duplicated"% \

SyntaxError: invalid syntax

I don't think it's a duplicated class, I think it's an error in the code catching duplicated classes. The code clearly shall give the name of the duplicated class, but no name is given.

tacocat88 gravatar imagetacocat88 ( 2016-07-20 00:30:13 -0500 )edit

ook, sorry, i did not get it ! ;)

berak gravatar imageberak ( 2016-07-20 00:31:50 -0500 )edit