-
Notifications
You must be signed in to change notification settings - Fork 8
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
Could not parse properly a header file: spectro from Avantes #16
Comments
Can you provide the error traceback? I haven't had a chance to get the code running on my system. Generally speaking, I think the issue is that this header uses |
Here is the traceback:
I applied a custom hook:
because it was having issues with the declaration of the functions using the token DLL_API defined as:
Following what you said I tried to create a token_hook to replace const by #define using :
but it seems the #define is not added ... and the parser then generates another error:
I therefore have three questions:
thx for the help |
Hi Nate, could you take some time to have a look at this please? |
I would suggest taking a look at the NiceLib docs, particularly this and following sections. For this sort of thing, it helps to have an understanding of C and the C preprocessor so I'd highly recommend reading up on them to be more comfortable. Here's a synopsis of how NiceLib preprocesses header files (as I remember it):
You can examine the source of As for your questions:
I'm not convinced the existing hook system can directly support your use case. I would either manually edit the header file or study |
Hi Nate,
I'm back with another library I'd like to add to instrumental but again I'm stuck with the header file parsing...
You'll find attached here a zip with the header file and my attempt in _build_avantes. I produced some hooks to clean the header but got some issues during parsing of binary operators. In particular from line 215 where it adds the value of a constant. But the parser considers USER_ID_LEN as an ID constant and not an integer one... Could not figure out the reason.
Some typedefs couldn't be parsed also after that (I tweaked the code to pass the previous issue with USER_ID_LEN but this is ugly).
Please help :-)
_avantes.zip
The text was updated successfully, but these errors were encountered: