Skip to content

"Undefined reference" when trying to reference Rust libraries from C. #561

Answered by jschwe
IoIxD asked this question in Q&A
Discussion options

You must be logged in to vote

cmake output

I don't see anything there - perhaps you copied a wrong link?

Which is fed into cbindgen, resulting in the following __internal__imageload.hpp:

Just to be sure: Is it in an extern "C" block?

If you run nm -D yourRustLib.so, does it show internal__Load__DynamicImage__FromMemory as T?
And if you look at the actual failing linker command line, is yourRustLib.so
a) on the line
b) to the right of your cpp image library?

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by IoIxD
Comment options

You must be logged in to vote
4 replies
@jschwe
Comment options

@IoIxD
Comment options

@jschwe
Comment options

@IoIxD
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants