You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having some trouble linking to highs-sys from my own crate. This is using v1.5.0 and rust v1.67.0 on Fedora 37. I have found two problems:
Missing libz requirement.
= note: /usr/bin/ld: /home/runner/work/pywr-next/pywr-next/target/debug/deps/libhighs_sys-0966d10c628bb43f.rlib(HMPSIO.cpp.o): undefined reference to symbol 'inflateEnd'
/usr/bin/ld: /lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
I fixed this locally by adding the following to build.rs.
println!("cargo:rustc-link-lib=dylib=z");
Failing to find the static library in the local build directory. For some reason it is added to lib64 and not lib on my system. I had to change build.rs to point to lib64 locally.
I am not at all sure why the tests for highs-sys pass fine with no modifications to build.rs, but I need both of these changes when linking from my crate. What am I doing wrong?
The text was updated successfully, but these errors were encountered:
I too needed to link libz and println!("cargo:rustc-link-lib=z"); did the job.
Perhaps my simplistic solution is too simplistic and narrow for a pull request #10 but at least there's a test included that will test if it is working or not.
Edit: Just wanted to leave a note and say the this did not work on Windows by itself but works if libz-sys is added as a dep. 👍
I am having some trouble linking to
highs-sys
from my own crate. This is using v1.5.0 and rust v1.67.0 on Fedora 37. I have found two problems:Full build log is here: https://github.com/pywr/pywr-next/actions/runs/4158414784/jobs/7193618930
I fixed this locally by adding the following to
build.rs
.lib64
and notlib
on my system. I had to changebuild.rs
to point tolib64
locally.I am not at all sure why the tests for
highs-sys
pass fine with no modifications tobuild.rs
, but I need both of these changes when linking from my crate. What am I doing wrong?The text was updated successfully, but these errors were encountered: