-
Notifications
You must be signed in to change notification settings - Fork 83
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
Include statements included in target header files #87
Comments
I'm seeing the |
Not certain if this is behaving the way you stated or not. I'm fairly certain that I have code which works the way you want it to work, not the way you describe it as behaving. The default system header files occur in wildly different places on different platforms and compilers - and they change over time. It is necessary to include -I directories for all the places you expect headers to be parsed. |
To the OP: yes, all include statements should be expanded by the C preprocessor called by ctypesgen, but you will have to either pass the indirect headers to ctypesgen directly OR use This branch of ctypesgen has that multilib support, but internally it's a bit of a messy matter IMHO. Ctypesgen cannot traverse the dependency tree and create separate linked bindings to different libs automatically. See also #86 (comment) and pypdfium2-team#1 for considerations. |
This is a usage / feature question which I hope is trivial to answer. When the header file which we unleash the tool on contains
#include
statements itself, is it currently supported to seamlessly generate also for those referenced header files?For example:
Header file XKBlib.h (/usr/include/X11/XKBlib.h) will typically contain the following includes:
Unless I'm experiencing a very specific bug, by plainly running the tool on this header file, I think that these referenced header files will not be processed.
Rather I will need to manually follow the chain of includes contained within the header file, and invoke this tool on each of them, in order to get all the symbols of the library of interest ready for ctypes use in python (I mean the library of which XKBlib.h is the "core" include file for, if this kind of naive relationship typically makes sense). Put differently, unlike the C compiler/s, this tool will not seamlessly follow referenced headers.
I am happy to learn whether this is a feature request or already implemented.
Or maybe it's uncommon for libraries to require the upstream user code to directly use symbols from nested header files and hence doesn't make sense (?!).
Thanks!
The text was updated successfully, but these errors were encountered: