Skip to content

unresolved external symbol _round / _trunc #36

Description

@otopetrik

I tried this code:

let a : f64 = 0.75;
println!("1: {}, 0: {}", a.round(), a.trunc());

(minimal example, added to main of rust9x-sample)

I expected to see this happen:

it should still compile and link (cargo +rust9x build --target i586-rust9x-windows-msvc)

Instead, this happened:

rust9x_sample.2zkro5s6070qsnwl.rcgu.o : error LNK2019: unresolved external symbol _round referenced in function __ZN3std3f6421_$LT$impl$u20$f64$GT$5round17hdb8bf8074c9d0b50E
rust9x_sample.2zkro5s6070qsnwl.rcgu.o : error LNK2019: unresolved external symbol _trunc referenced in function __ZN3std3f6421_$LT$impl$u20$f64$GT$5trunc17hd85680ad541ba85dE
<some path>\rust9x-sample\target\i586-rust9x-windows-msvc\debug\deps\rust9x_sample.exe : fatal error LNK1120: 2 unresolved externals

The issue also appears when program depends on crates config and/or time.

Meta

rustc +rust9x --version --verbose:

rustc 1.76.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-msvc
release: 1.76.0-dev
LLVM version: 17.0.6

rust9x-1.76-beta-v5 on Windows 10

Installation uses:

  • "Microsoft Windows SDK for Windows 7" for link.exe (PATH environment variable).
  • "Microsoft Windows SDK for Windows 7" which does not have ntdll.lib and "Windows 10 SDK version 2104 (10.0.20348.0)" for ntdll.lib (LIB environment variable)

Unmodified sample compiled and linked correctly. Minimal reqwest example also successfully compiles, links and runs:

the example from reqwest readme file

use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let resp = reqwest::get("https://httpbin.org/ip")
        .await?
        .json::<HashMap<String, String>>()
        .await?;
    println!("{resp:#?}");
    Ok(())
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions