{"action":"created","issue":{"url":"https://api.github.com/repos/gccxml/pygccxml/issues/45","repository_url":"https://api.github.com/repos/gccxml/pygccxml","labels_url":"https://api.github.com/repos/gccxml/pygccxml/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/gccxml/pygccxml/issues/45/comments","events_url":"https://api.github.com/repos/gccxml/pygccxml/issues/45/events","html_url":"https://github.com/gccxml/pygccxml/issues/45","id":142982377,"number":45,"title":"Unable to find out actual class definition: ''.","user":{"login":"othi","id":331956,"avatar_url":"https://avatars.githubusercontent.com/u/331956?v=3","gravatar_id":"","url":"https://api.github.com/users/othi","html_url":"https://github.com/othi","followers_url":"https://api.github.com/users/othi/followers","following_url":"https://api.github.com/users/othi/following{/other_user}","gists_url":"https://api.github.com/users/othi/gists{/gist_id}","starred_url":"https://api.github.com/users/othi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othi/subscriptions","organizations_url":"https://api.github.com/users/othi/orgs","repos_url":"https://api.github.com/users/othi/repos","events_url":"https://api.github.com/users/othi/events{/privacy}","received_events_url":"https://api.github.com/users/othi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-23T14:53:58Z","updated_at":"2016-03-23T17:20:29Z","closed_at":null,"body":"I seem to have stumbled on a bug while trying to use Py++ on a larger project.\r\n\r\nHere is a snippet that reproduces the bug:\r\n\r\n```\r\n#include <map>\r\nnamespace std {\r\nclass apta_node;\r\ntypedef map<int, apta_node*> child_map;\r\nclass apta_node{\r\npublic:\r\n    child_map children;\r\n};\r\n}\r\n```\r\n\r\n\r\nHere's how I try to build the module:\r\n\r\n```\r\nfrom pyplusplus import module_builder\r\nmb = module_builder.module_builder_t(\r\n    files=['test.h'],\r\n    include_paths=[\"/usr/include/x86_64-linux-gnu/c++/5\", \"/usr/include/c++/5\"],\r\n    cflags=\"-std=c++11\"\r\n)\r\n```\r\n\r\nAnd here's the output and error message:\r\n\r\n```\r\nd@machine:~/dev/pyplusplustest$ python3 test_generate.py \r\nINFO Parsing source file \"test.h\" ... \r\nerror: invalid argument '-std=c++11' not allowed with 'C/ObjC'         # I need to add it or --castxml-gccxml doesn't work. The XML files generates fine.\r\nTraceback (most recent call last):\r\n  File \"test_generate.py\", line 8, in <module>\r\n    cflags=\"-std=c++11\"\r\n  File \"/usr/local/lib/python3.4/dist-packages/pyplusplus-1.1.0-py3.4.egg/pyplusplus/module_builder/boost_python_builder.py\", line 106, in __init__\r\n  File \"/usr/local/lib/python3.4/dist-packages/pyplusplus-1.1.0-py3.4.egg/pyplusplus/module_builder/boost_python_builder.py\", line 149, in __parse_declarations\r\n  File \"/usr/local/lib/python3.4/dist-packages/pygccxml/parser/project_reader.py\", line 249, in read_files\r\n    return self.__parse_file_by_file(files)\r\n  File \"/usr/local/lib/python3.4/dist-packages/pygccxml/parser/project_reader.py\", line 319, in __parse_file_by_file\r\n    self._relink_declarated_types(leaved_classes, types)\r\n  File \"/usr/local/lib/python3.4/dist-packages/pygccxml/parser/project_reader.py\", line 544, in _relink_declarated_types\r\n    raise Exception(os.linesep.join(msg))\r\nException: Unable to find out actual class definition: ''.\r\nClass definition has been changed from one compilation to an other.\r\nWhy did it happen to me? Here is a short list of reasons: \r\n    1. There are different preprocessor definitions applied on same file during compilation\r\n    2. Bug in pygccxml.\r\n```\r\n\r\n\r\nAfter a bit of fiddling, I *think* the problematic line is `/usr/include/c++/5/bits/stl_tree.h:1407`\r\n\r\nUsing Ubuntu 15.10, pygccxml 1.7.2 (and latest development branch), gccxml from Ubuntu repository (wrapper around CastXML 0.1-g8a08a44)."},"comment":{"url":"https://api.github.com/repos/gccxml/pygccxml/issues/comments/200449276","html_url":"https://github.com/gccxml/pygccxml/issues/45#issuecomment-200449276","issue_url":"https://api.github.com/repos/gccxml/pygccxml/issues/45","id":200449276,"user":{"login":"praetorian20","id":10395685,"avatar_url":"https://avatars.githubusercontent.com/u/10395685?v=3","gravatar_id":"","url":"https://api.github.com/users/praetorian20","html_url":"https://github.com/praetorian20","followers_url":"https://api.github.com/users/praetorian20/followers","following_url":"https://api.github.com/users/praetorian20/following{/other_user}","gists_url":"https://api.github.com/users/praetorian20/gists{/gist_id}","starred_url":"https://api.github.com/users/praetorian20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praetorian20/subscriptions","organizations_url":"https://api.github.com/users/praetorian20/orgs","repos_url":"https://api.github.com/users/praetorian20/repos","events_url":"https://api.github.com/users/praetorian20/events{/privacy}","received_events_url":"https://api.github.com/users/praetorian20/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T17:20:29Z","updated_at":"2016-03-23T17:20:29Z","body":"Why are you adding things to `namespace std`? That makes your code [ill-formed](http://en.cppreference.com/w/cpp/language/extending_std). Can the problem be reproduced if you add those definitions to your own namespace?\r\n\r\nIf you can reproduce the error with a different namespace, then paste these lines in your `test_generate.py` file (at the very top, immediately after you import modules) to enable debug logging and paste the output here.\r\n\r\n```\r\nimport logging\r\npyplusplus.module_builder.set_logger_level(logging.DEBUG)\r\npygccxml.utils.loggers.set_level(logging.DEBUG)\r\n```"}}