After that I executed cargo build, and received the error:
error: proc-macro derive panicked
--> src/lib.rs:9:2
|
9 | cpp!([] {
| _____^
10 | | printf("Hello, World!\n");
11 | | });
| |_______^
|
= help: message:
-- rust-cpp fatal error --
The OUT_DIR environment variable was not set.
NOTE: rustc must be run by Cargo.: NotPresent
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to previous error
error: Could not compile `cpp`.
To learn more, run the command again with --verbose.
How to fix it? Also note that if I have a binary project, no errors are displayed.
I am trying to build my library which uses
cpp
.src/build.rs
:src/lib.rs
:After that I executed
cargo build
, and received the error:How to fix it? Also note that if I have a binary project, no errors are displayed.