-
Notifications
You must be signed in to change notification settings - Fork 290
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
Can't find struct from other crate #50
Comments
My understanding is that I'm not sure there's an easy fix for this short of hooking into compiler internals (I actually started writing a guide for doing this), which would constrain cbindgen to nightly because compiler internals are always going to be unstable. |
The issue here is that you are specifying a specific file, instead of a crate. This causes cbindgen to use single source mode which doesn't parse external crates (because it doesn't have context to know where external crates are). A warning here would probably be a good idea.
This is partially true. cbindgen can be configured to emulate cargo and rustc's crate searching behavior, without using compiler internals. This only works with crate parsing mode, which is the bug here. |
Forgot to add that the command should probably be: $ cbindgen -v svg2polylines-ffi/ -c cbindgen.toml -o svg2polylines.h |
I've added a warning for this in version |
Steps to reproduce:
The
CoordinatePair
struct is defined in thesvg2polylines
crate and is pretty simple:What's the reason why it can't be found?
The text was updated successfully, but these errors were encountered: