I'm compiling a Rust program on Windows and I need to link to an external C library statically.
I know where the .lib
file is on my computer and the compilation works if I provide the -L
flag with an absolute path to the directory where the .lib
file exists.
What I want to know is, can I just add this path to an environment variable instead of having to provide Rust with the -L
flag every single time I compile?
I tried setting the LIB
environment variable, which I think is the one MSVC uses, and I even tried setting the LIBRARY_PATH
environment variable. But Rust doesn't seem to pick up on these, and compilation fails unless I provide the path with the -L
flag.