Skip to content

std is required by sha1 because it does not declare #![no_std] #15

@jackxl

Description

@jackxl

Having the following issue trying to compile the bare minimum:

Error:

   Compiling generic-array v0.14.6
   Compiling generic-array v0.12.4
   Compiling generic-array v0.13.3
   Compiling sha1 v0.6.1
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabi` target may not support the standard library
  = note: `std` is required by `sha1` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std

For more information about this error, try `rustc --explain E0463`.
error: could not compile `sha1` due to previous error
warning: build failed, waiting for other jobs to finish...

Even though I've set the dependency of embedded-websocket as instructed in the readme.
Also as far as I can see sha1 does declare #![no_std] but the error says no.

note: importing sha1 in my project (with default-features = false) and removing embedded-websocket does not produce the error.

What is going on here and what would be the proper way to resolve this issue?

rustc --version: rustc 1.66.0-nightly (758f19645 2022-10-24)
Cargo.toml:

[package]
name = "sandbox"
version = "0.1.0"
edition = "2021"

[dependencies]
embedded-websocket = { version = "0.8.0", default-features = false }

.cargo/config.toml:

[build]
target = "thumbv7em-none-eabi"

src/main.rs:

#![no_std]
fn main() {
    //println!("Hello, world!");
}

Kind regards,

Jack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions