rust

How can I type “cargo run” without needing to set the LD_LIBRARY_PATH shell variable?

纵然是瞬间 提交于 2020-08-27 12:03:50
问题 I build a Rust program that calls a C++ function via a C interface. In order to execute the program, I have to run: export LD_LIBRARY_PATH=<path to shared c lib> or I get an error: error while loading shared libraries: libtest.so: cannot open shared object file: No such file or directory I tried to set the variable in a build script using std::process::Command Command::new("sh").arg("export").arg("LD_LIBRARY_PATH=<path to shared c lib>"); Although the command executes without an error, the

How can I type “cargo run” without needing to set the LD_LIBRARY_PATH shell variable?

回眸只為那壹抹淺笑 提交于 2020-08-27 12:00:10
问题 I build a Rust program that calls a C++ function via a C interface. In order to execute the program, I have to run: export LD_LIBRARY_PATH=<path to shared c lib> or I get an error: error while loading shared libraries: libtest.so: cannot open shared object file: No such file or directory I tried to set the variable in a build script using std::process::Command Command::new("sh").arg("export").arg("LD_LIBRARY_PATH=<path to shared c lib>"); Although the command executes without an error, the

How can I type “cargo run” without needing to set the LD_LIBRARY_PATH shell variable?

只愿长相守 提交于 2020-08-27 11:59:01
问题 I build a Rust program that calls a C++ function via a C interface. In order to execute the program, I have to run: export LD_LIBRARY_PATH=<path to shared c lib> or I get an error: error while loading shared libraries: libtest.so: cannot open shared object file: No such file or directory I tried to set the variable in a build script using std::process::Command Command::new("sh").arg("export").arg("LD_LIBRARY_PATH=<path to shared c lib>"); Although the command executes without an error, the

How can I get the compiler to warn me of unused code that is marked pub?

匆匆过客 提交于 2020-08-27 08:29:48
问题 Rust warns for unused private items: warning: function is never used: `hmm` --> src/example.rs:357:1 | 357 | fn hmm() { | ^^^^^^^^ | = note: #[warn(dead_code)] on by default I have some code marked pub that I know is not being used. How can I get the compiler to warn me of this? This is in the context of a library and a series of binaries, all in the same workspace. The library is only used by those binaries; the library isn't being consumed by anybody else and I'm not going to upload to