Hi,
I'm trying to run some Rust code from a C project and I run into a link error. The Rust code looks like this
#[no_mangle]
pub extern fn call_from_c() {
}
And the C program looks like this
extern void call_from_c();
int main() {
call_from_c();
}
I build with this command line (rust code is built with Cargo)
clang test.c target/debug/libapi_test.rlib -o test
I then get this link error:
Undefined symbols for architecture x86_64:
"___morestack", referenced from:
_call_from_c in libapi_test.rlib(api_test.0.o)
call_from_c::__rust_abi in libapi_test.rlib(api_test.0.o)
When searching it seems that other people have run into the same issue but I couldn't really find and solution for it.
clang --version
Apple LLVM version 7.0.0 (clang-700.0.53.3)
Target: x86_64-apple-darwin15.0.0
rustc --version
rustc 1.3.0 (9a92aaf19 2015-09-15)
Any ideas how to solve this would be great.
Cheers!