I have a problem with linking to a C library.
I have set the build
and links
parameter in Cargo.toml.
There is a libCbcSolver.lib
in C:\Cbc\lib
and I set cargo:rustc-link-lib=libCbcSolver
and cargo:rustc-link-search
to PATH
, which includes C:\Cbc\lib
. But still the build fails with no LINK : fatal error LNK1181: cannot open input file 'libCbcSolver.lib
Does someone have an idea what I did wrong here: https://github.com/KardinalAI/coin_cbc/pull/2/checks?check_run_id=1304610906
The same also happens on my Windows machine, it is not a problem with Github Action.
You'll need to print a separate cargo:rust-link-search
line for each directory in the PATH
, rather than printing a single line containing all of them.
You can run the following command to check the output of the build script. (You might need to cargo clean
first to force it to re-run the script.)
cargo build -vv
Double-check that the output includes a line with this exact format:
cargo:rustc-link-search=C:\Cbc\lib
1 Like
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.