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

KeyError: (('/usr/include/c++/7/type_traits', 580), ('::', 'std', 'type')) #105

Open
manuka89 opened this issue Jun 7, 2019 · 4 comments

Comments

@manuka89
Copy link

manuka89 commented Jun 7, 2019

Hi there,

I have encountered the following error during the execution of pygccxml. If I launch castXML myself it sucessfully generates the XML file so I guess the issue comes from the parsing:

decls = parser.parse([filename], config)

File "/usr/lib/python2.7/site-packages/pygccxml/parser/init.py", line 51, in parse
declarations = parser.read_files(files, compilation_mode)
File "/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 264, in read_files
return self.__parse_file_by_file(files)
File "/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 332, in __parse_file_by_file
leaved_classes = self._join_class_hierarchy(answer)
File "/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 481, in _join_class_hierarchy
derived_info.related_class)]
KeyError: (('/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits', 580), ('::', 'std', 'type'))

I'm using clang 8.0, castXML 0.2 botuh compiled with GCC 7.3 on CentOS 7.6.

@manuka89
Copy link
Author

manuka89 commented Jun 7, 2019

If I'm generating the xml file myself and then using the parse_xml_file function imported from "parser" I manage to parse the file.

@manuka89
Copy link
Author

manuka89 commented Jun 7, 2019

By adding the flag compilation_mode=parser.COMPILATION_MODE.ALL_AT_ONCE to the parser it works as well with pygccxml

I'm trying to parse only one hpp file but it contains lots of template classes and other includes.

@manuka89
Copy link
Author

I was trying to figure it out the source of the issue but I have not managed it yet. Does somebody have an advice?

@wzawisa
Copy link

wzawisa commented Aug 11, 2020

Did anyone have any luck solving this one? I am currently experiencing the same error trying to parse 2 C++ headers using cast XML and py++

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

No branches or pull requests

2 participants