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

the libz-rs-sys cdylib is not a drop-in replacement to libz #126

Closed
glandium opened this issue Jul 31, 2024 · 0 comments · Fixed by #127
Closed

the libz-rs-sys cdylib is not a drop-in replacement to libz #126

glandium opened this issue Jul 31, 2024 · 0 comments · Fixed by #127

Comments

@glandium
Copy link

glandium commented Jul 31, 2024

Build the cdylib:

$ cargo build -p libz-rs-sys

Download an example program using zlib in C:

$ wget https://www.zlib.net/zpipe.c

Compile and link against libz-rs-sys:

$ cc -o zpipe zpipe.c target/debug/deps/liblibz_rs_sys.so

(Funnily enough, because cargo doesn't set a SONAME on cdylib, this links the library such that running the resulting executable works without a LD_LIBRARY_PATH)

Run the program:

$ ./zpipe
zpipe: zlib version mismatch!
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

Successfully merging a pull request may close this issue.

1 participant