-
Notifications
You must be signed in to change notification settings - Fork 45
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
Unable to find out actual class definition: ''. #45
Comments
Why are you adding things to If you can reproduce the error with a different namespace, then paste these lines in your
|
The namespace was a blunder from when I created the test file. The problem remains the same if I just use the std namespace. :) Here's the output after adding the debug logging:
|
It also does not work when just trying to create an instance of map, without typedef or forward declaration. The debug and log output is the same.
|
Your problem is you're using GCCXML for parsing your header. GCCXML is a fork of a very old GCC (version 4.3 IIRC), so it's no wonder it doesn't know what You should switch over to CastXML, it's the successor to GCCXML, and works with |
Indeed. I switched to CastXML:
The end result remains the same:
Note: |
CastXML is being invoked with this command
Is @iMichka Can you please takeover helping with this issue? I won't be able to get back to it until next week. |
@praetorian20 Thanks for starting debugging this. @othi thanks for reporting the problem. I hope we will be able to get that sorted out. I just ran the code on my Mac with py++ (latest commit) and pygccxml (latest commit), using the latest castxml and clang. Everything went fine. But it should also work with older versions of py++/pygccxml. I think knowing which compiler was used would help debug this. As asked above, is I can try to install ubuntu 15.10 in a virtual box and setup the same build env as you, to try to reproduce the error. I'll do that this weekend if the debugging here is not helping. |
Sorry I didn't have a lot of time today to work on this. /usr/bin/c++ is an alias for /usr/bin/g++-5. I'm going to fiddle around with the compiler path and report back. Thanks for your quick responses! |
The result is the same when used with the
Or when used with clang:
|
Ok thanks. I am currently installing Wily and gcc5, I'll try to reproduce the problem there. |
Good news, I could reproduce the error. I'll try to fix this but it may take a little bit of time, depending on how complex that part of the code is. |
This is failing with gcc5 + castxml + std=c++11 flag with the following error: parsing files - started DEBUG Reading project files: file by file INFO Parsing source file "test.h" ... DEBUG Reading source file: [test.h]. DEBUG File has not been found in cache, parsing... DEBUG castxml cmd: /usr/bin/castxml -std=c++11 -I. -c -x c++ --castxml-cc-gnu "(" /usr/bin/clang -std=c++11 ")" --castxml-gccxml -o /tmp/tmpmsq0r7kr.xml test.h DEBUG CASTXML version - None ( 1.136 ) <snip> File "/usr/local/lib/python3.4/dist-packages/pygccxml-1.7.2-py3.4.egg/pygccxml/parser/project_reader.py", line 544, in _relink_declarated_types Exception: Unable to find out actual class definition: ''. Class definition has been changed from one compilation to an other. Why did it happen to me? Here is a short list of reasons: 1. There are different preprocessor definitions applied on same file during compilation 2. Bug in pygccxml.
With gcc5 + castxml + std=c++11 some code was not parseable by pygccxml (see previous commit). This fixes the problem, but is probably not the final solution, but as the other cases in the relink method, a better understanding of this code part should hopefully help find a better strategy to handle these cases.
I pushed a fix. It's not perfect, as this part of the code is not really clear. As all the tests pass, I am quite confident this did not break anything else. Could you please test again on your side ? Be aware that there are still a bunch of errors in the container traits part with gcc5, which I discovered while running the tests. If you happen to use pygccxml's container traits it may be broken. I opened another bug for this (#47) (this problem is not related to this one). |
This fixed the issue, thank you very much. I may have found another one - I'll dig a little deeper and try to build a concise test case before I report it. |
Great. I'll close this issue then. Please open a new one for the second issue. A test case is always welcome. |
I seem to have stumbled on a bug while trying to use Py++ on a larger project.
Here is a snippet that reproduces the bug (edited out the namespace blunder for clearness sake):
Here's how I try to build the module:
And here's the output and error message:
After a bit of fiddling, I think the problematic line is
/usr/include/c++/5/bits/stl_tree.h:1407
Using Ubuntu 15.10, pygccxml 1.7.2 (and latest development branch), gccxml from Ubuntu repository (wrapper around CastXML 0.1-g8a08a44).
The text was updated successfully, but these errors were encountered: