rust-cpp icon indicating copy to clipboard operation
rust-cpp copied to clipboard

Undefined reference to `__cpp_closure_xxx`

Open david-bouyssie opened this issue 3 years ago • 2 comments

I have tried this crate using the following examples: https://docs.rs/cpp/0.5.5/cpp/ https://docs.rs/cpp/0.5.5/cpp/macro.cpp.html

However, my linker is failing and prints the following error: undefined reference to `__cpp_closure_17383989895670653357'

What am I doing wrong?

Thanks.

david-bouyssie avatar Nov 13 '20 19:11 david-bouyssie

Looks like the link is failing, What platform are you running on. Are you using linker flag. the build.rs script should print a line to let cargo know it needs to link against the generated library.

ogoffart avatar Nov 15 '20 09:11 ogoffart

I tried both on Windows x64 and Ubuntu x64. My rustc version is: 1.47.0 (18bf6b4f0 2020-10-07)

I also tried to git clone the rust-cpp and do a cargo test. I have a similar error.

Note that cxx (https://github.com/dtolnay/cxx) is working, as an alternative solution.

david-bouyssie avatar Nov 15 '20 18:11 david-bouyssie

Looks like a similar problem to https://github.com/mystor/rust-cpp/issues/107 Closing this one as it has less details.

ogoffart avatar Aug 16 '23 07:08 ogoffart