Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling for no_std #1

Open
the-shank opened this issue Apr 11, 2024 · 0 comments
Open

compiling for no_std #1

the-shank opened this issue Apr 11, 2024 · 0 comments

Comments

@the-shank
Copy link

the-shank commented Apr 11, 2024

Hi, I cant seem to build the crate for no_std.

From lib.rs, I understand that a cfg no_std is required in order to enable no_std.

In order to enable this, I am trying to build using the command:

cargo +stable rustc -- --cfg no_std

But then the build fails.

❯ cargo +stable rustc -- --cfg no_std
   Compiling proc-macro2 v1.0.79
   Compiling autocfg v1.2.0
   Compiling unicode-ident v1.0.12
   Compiling syn v1.0.109
   Compiling cfg-if v1.0.0
   Compiling cargo-emit v0.2.1
   Compiling indoc v1.0.9
   Compiling convert_case v0.4.0
   Compiling log v0.4.21
   Compiling float-cmp v0.9.0
   Compiling num-traits v0.2.18
   Compiling integer_or_float v0.3.2 (/home/common/rustforembedded-ws/crates_nostd_stable/integer_or_float-0.3.2)
   Compiling quote v1.0.35
   Compiling derive_more v0.99.17
error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> src/error/str_conv.rs:5:5
  |
5 | use std::error::Error;
  |     ^^^ use of undeclared crate or module `std`

error[E0412]: cannot find type `String` in this scope
  --> src/str_conv/ryu.rs:19:39
   |
19 | pub(crate) fn _maybe_ryu(f: f_iof) -> String {
   |                                       ^^^^^^ not found in this scope

error[E0412]: cannot find type `String` in this scope
  --> src/str_conv/mod.rs:16:31
   |
16 | impl From<IntegerOrFloat> for String {
   |                               ^^^^^^ not found in this scope

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `integer_or_float` (lib) due to 3 previous errors
@the-shank the-shank changed the title How to compile for no_std compiling for no_std Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant