Closed wucke13 closed 5 years ago
error[E0463]: can't find crate for
std
Likely src/main.rs
does not have the #![no_std]
attribute in it.
Thats it! Thanks!
error[E0463]: can't find crate for
std
Likely
src/main.rs
does not have the#![no_std]
attribute in it.
But if i want to print "Hello world" by using std::println! , what should I do?
@H-Y-B This might answer your question :-) https://docs.rust-embedded.org/discovery/06-hello-world/index.html
What if one needs to use other std libraries like std::ptr for example?
What if one needs to use other std libraries like std::ptr for example?
Everything you can use in a #[no_std]
context is in core
, for example: core::ptr. Many std
modules are re-exported from core.
Is there a way to find out where std
is used? I have the #![no_std]
in my main.
@Niondir Isn't it already stated in the cargo
output? Other than that, just grep for std::
in your src
. Do you have any deps through Cargo.toml
? Some deps have no_std as a feature, which needs to be invoked explicitly for them to be no_std conform.
I actually found another file where the #![no_std]
was missing.
The output of the error is the following:
rustup show
shows that the needed target is installed, though:What causes this?