Open cv 2.4 - opencv_java build error - gen_java.py

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

tacocat88 gravatar image

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

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 gen_java.py 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 classinfo.name in class_ignore_list:

return

name = classinfo.name

if name in self.classes:

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

(name, classinfo.cname)

Return....

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)

return...

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

Comments

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 -0600 )edit

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

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

Line 34, visual studio:Generating core.cpp

Line 34, visual studio: File "c:/users/.../gen_java.py, 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 -0600 )edit

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

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