-
-
Notifications
You must be signed in to change notification settings - Fork 2
How to debug an error with "Errors encountered parsing headers, unable to proceed with conversion" #27
Comments
Alright, so with the help of
But now I am stumped again: |
Aha! Just to be sure, I changed the |
It is true that First, create a fake cstddef file If the Let me know how far that gets you. |
Thanks for these suggestions! I went ahead and removed the problematic lines (or disabled them as suggested), but that just kicks the can down the road. Now it complains with
where the offending line is The Any idea why LibClang is having so much trouble parsing these C++ files? Or is this a general limitation that I am just not aware of? |
The usage of LibClang in CBindingGen is as a C parser, it is possible (and I will get around to it some day) to use it for parsing C++ though. Adding BTW, I am working on a "v2.0" of the |
Unfortunately, this did not really help. I even added
and many more like them. I think the problem is that any non-C code just does not get parsed properly, maybe with the exception to some macros and C++-style single-line comments. Even if I manually change line 16 in SEAL_C_FUNC BatchEncoder_Create(void *context, void **batch_encoder); to extern "C" long BatchEncoder_Create(void *context, void **batch_encoder); the error remains unchanged. It is only fixed if I go for pure C with long BatchEncoder_Create(void *context, void **batch_encoder); Thus, to me it seems like as if |
That's great to hear - and thanks again for your fast and helpful support. I do like |
The |
Thanks, this got me a little further. I have now an additional file // Include stdbool.h to introduce `bool`
#include "stdbool.h"
// Include defines.h and then redefine the SEAL_C_FUNC macro to remove the `extern "C"`
#include "seal/c/defines.h"
#define SEAL_C_FUNC HRESULT Added to that, I have a file
Thus it seems like it just goes on and on and on, trying to trick the C++ files into looking like valid C files, and I am not sure I will be able to fix everything from outside (plus, it is very ugly). I also tried a different tack and passed P.S.: If it helps and if you'd be willing to have a look at it, I can also push my current work to a branch of SEAL.jl such that you can reproduce my results. UPDATE Here is the related code JuliaCrypto/SEAL.jl#20 |
Ok, thanks for the access! I should get the new version out sometime in the next week, but it is C-only still. It is totally possible to use LibClang to parse C++ too, I just haven't done that yet. Generating C++ bindings for the SEAL library might be a nice first use case as its mostly a C API, just not proper C. |
CBinding.jl v1 now reports compilation errors, and a bare minimum support for C++ to support the SEAL library will be available in an upcoming release of it. |
While trying to generate bindings for a C library in
deps/build.jl
, I cannot get past the call toconvert_headers
, since it always throws an error asI have tried looking at
CBindingGen.jl:193
, but I cannot figure out how to make LibClang tell me what is actually the problem (e.g., is it a bad include directory, or is it something in the headers themselves etc.). Can you give me advice on how to proceed here, i.e., how to debug the error that caused this message?The text was updated successfully, but these errors were encountered: