I'm having trouble declaring an example in the crate manifest.
The example compiles and works correctly on 'android' and 'linux' targets but I can't declare it in such a way that it is possible to compile and run the example for both operating systems.
To run and compile for target 'linux' I don't even need to declare it, just run the command cargo run --example window
.
For the target 'android' I need to declare in the manifest:
[[example]]
name = "window"
crate-type = ["cdylib"]
The problem is that if I declare in the manisfet I can't run the example for the 'linux' target, the compilation happens normally, even if I declare "bin" in crate-type.
The error returned when I try to execute is: error: example target `window` is a library and cannot be executed
.
How do I make crate-type work correctly?