Skip to content
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

Error with bindgen 0.52 #1694

Closed
gwenn opened this issue Dec 13, 2019 · 2 comments
Closed

Error with bindgen 0.52 #1694

gwenn opened this issue Dec 13, 2019 · 2 comments

Comments

@gwenn
Copy link

gwenn commented Dec 13, 2019

Bindgen 0.51 is fine.
But with bindgen 0.52:

error: linking with `cc` failed: exit code: 1
...
 = note: /home/travis/build/jgallagher/rusqlite/target/debug/deps/libbindgen-8d08512025d35d16.rlib(bindgen-8d08512025d35d16.bindgen.863a57vr-cgu.7.rcgu.o): In function `bindgen::clang::EvalResult::as_int::h7466386cd7d4bef8':
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2013: undefined reference to `clang_EvalResult_isUnsignedInt'
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2022: undefined reference to `clang_EvalResult_getAsLongLong'
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2014: undefined reference to `clang_EvalResult_getAsUnsigned'
/home/travis/build/jgallagher/rusqlite/target/debug/deps/libbindgen-8d08512025d35d16.rlib(bindgen-8d08512025d35d16.bindgen.863a57vr-cgu.7.rcgu.o): In function `bindgen::clang::TargetInfo::new::hcf80461fab469455':
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2071: undefined reference to `clang_getTranslationUnitTargetInfo'
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2072: undefined reference to `clang_TargetInfo_getTriple'
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2073: undefined reference to `clang_TargetInfo_getPointerWidth'
/home/travis/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/bindgen-0.52.0/src/clang.rs:2074: undefined reference to `clang_TargetInfo_dispose'
collect2: error: ld returned 1 exit status
error: linking with `gcc` failed: exit code: 1
...
  = note: ld: cannot find -lclang.dll

Locally, on a Linux VM (Archlinux), build succeeds.

@emilio
Copy link
Contributor

emilio commented Dec 13, 2019

Are you using default-features = false? I think you need to change to features = ["dynamic"] if so so that clang is runtime-detected. Otherwise it needs a relatively-new libclang version.

This is fallout from #1649.

gwenn added a commit to gwenn/rusqlite that referenced this issue Dec 14, 2019
rust-lang/rust-bindgen#1694 (comment)
> Are you using default-features = false? I think you need to change to
features = ["dynamic"] if so so that clang is runtime-detected.
Otherwise it needs a relatively-new libclang version.
@gwenn
Copy link
Author

gwenn commented Dec 14, 2019

Indeed, features = ["runtime"] fixes all problems.
Thanks.

@gwenn gwenn closed this as completed Dec 14, 2019
hhirtz added a commit to LIHPC-Computational-Geometry/metis-rs that referenced this issue Jun 19, 2023
this makes bindgen load libclang during the execution of build instead
of its compilation.

it also has the advantage that older versions of clang are supported.
see the following links for statements:
- rust-lang/rust-bindgen#1694
- https://github.com/Janekdererste/metis-rs#why-this-fork
hhirtz added a commit to LIHPC-Computational-Geometry/metis-rs that referenced this issue Jul 24, 2023
this makes bindgen load libclang during the execution of build instead
of its compilation.

it also has the advantage that older versions of clang are supported.
see the following links for statements:
- rust-lang/rust-bindgen#1694
- https://github.com/Janekdererste/metis-rs#why-this-fork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants