Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DuplicateDefinitionException: 'register: struct__IO_marker already existed: struct__IO_marker' #71

Open
XVilka opened this issue May 21, 2020 · 1 comment

Comments

@XVilka
Copy link

XVilka commented May 21, 2020

genbind.py in gen_python_bindings(outdir, path)
    222     cparser = clangparser.Clang_Parser(flags=clang_opts)
    223     print("Parsing {0:s} file...\n".format(path))
--> 224     cparser.parse(path)
    225     items = cparser.get_result()
    226     if items is None:

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/clangparser.py in parse(self, filename)
    118         root = self.tu.cursor
    119         for node in root.get_children():
--> 120             self.startElement(node)
    121         return
    122 

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/clangparser.py in startElement(self, node)
    157         # build stuff.
    158         try:
--> 159             stop_recurse = self.parse_cursor(node)
    160             # Signature of parse_cursor is:
    161             # if the fn returns True, do not recurse into children.

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/clangparser.py in parse_cursor(self, cursor)
    271     def parse_cursor(self, cursor):
    272         """Forward parsing calls to dedicated CursorKind Handlder"""
--> 273         return self.cursorkind_handler.parse_cursor(cursor)
    274 
    275     def parse_cursor_type(self, _cursor_type):

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/cursorhandler.py in parse_cursor(self, cursor)
     35     def parse_cursor(self, cursor):
     36         mth = getattr(self, cursor.kind.name)
---> 37         return mth(cursor)
     38 
     39         ##########################################################################

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/util.py in fn(*args, **kwargs)
    117         log.debug("%s: displayname:'%s'",func.__name__, name)
    118         # print 'calling {}'.format(func.__name__)
--> 119         return func(*args, **kwargs)
    120     return fn
    121 

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/cursorhandler.py in STRUCT_DECL(self, cursor, num)
    561         Its a wrapper to _record_decl.
    562         """
--> 563         return self._record_decl(cursor, typedesc.Structure, num)
    564 
    565     @log_entity

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/cursorhandler.py in _record_decl(self, cursor, _output_type, num)
    601             self.set_location(obj, cursor)
    602             self.set_comment(obj, cursor)
--> 603             return self.register(name, obj)
    604 
    605         elif size < 0 or align < 0:

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/handler.py in register(self, name, obj)
     42 
     43     def register(self, name, obj):
---> 44         return self.parser.register(name, obj)
     45 
     46     def get_registered(self, name):

~/.local/lib/python3.8/site-packages/ctypeslib2-2.2.2-py3.8.egg/ctypeslib/codegen/clangparser.py in register(self, name, obj)
    178             log.debug('register: %s already existed: %s', name, obj.name)
    179             # code.interact(local=locals())
--> 180             raise DuplicateDefinitionException(
    181                 'register: %s already existed: %s' % (name, obj.name))
    182         log.debug('register: %s ', name)

DuplicateDefinitionException: 'register: struct__IO_marker already existed: struct__IO_marker'
@trolldbois
Copy link
Owner

@XVilka can you share the relevant source file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants