Open erdikilic opened 10 months ago
Same here
How did you know to use ar? I would never have thought of that, thank you very much
Hello @DanielUMorales, @erdikilic .
I encountered the same error, and my solution was to use a archive file instead of the object file.
clang src/multiply.c -c
ar rcs libmultiply.a multiply.o
rustc src/main.rs -l multiply -L .
./main
[Rust] Hello from Rust! 🦀
[Rust] Calling function in C..
[C] Hello from C!
[C] Input a is: 5000
[C] Input b is: 5
[C] Multiplying and returning result to Rust..
[Rust] Result: 25000
Hi,
Firstly thanks for the tutorial. I follow the steps but I got this error at step 3. I am so new in rust and c, and could not solve the problems. However, when I run this
ar rcs libmultiply.a multiply.o
and thenrustc -l static=multiply -L . src/main.rs
, it works as expected. Are there any options to run withoutar rcs
?