sit
sit

Reputation: 360

Unable to use f32.rs functions, linker error

I'm making a program in Rust, and when trying to use functions like ceilf32 or basically anything from libcore/num/f32.rs I get this linker error:

// ... trim ...
= note: rust-lld: error: undefined symbol: ceilf
          >>> referenced by mod.rs:82 (src\drawing\mod.rs:82)
          >>>               [...]\target\target\debug\deps\[...]-c4acb8cd5708d25a.2grsqixgn2a8hmah.rcgu.o:([...]::drawing::Drawer::draw_string::_$u7b$$u7b$closure$u7d$$u7d$::h20d7003446a3ba40)
          
          rust-lld: error: undefined symbol: fmaxf
          >>> referenced by f32.rs:587 ([...]\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore\num\f32.rs:587)
          >>>               [...]\target\debug\deps\[...]-c4acb8cd5708d25a.3cee1874z9uvxtqi.rcgu.o:(core::f32::_$LT$impl$u20$f32$GT$::max::h6081b63ab8c0dd46)
          >>> referenced by f32.rs:587 ([...]\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore\num\f32.rs:587)
          >>>               rusttype-2d0e899828253f14.rusttype.cose1gzm-cgu.6.rcgu.o:(core::f32::_$LT$impl$u20$f32$GT$::max::h99a39b63866c48df) in archive [...]\target\target\debug\deps\librusttype-2d0e899828253f14.rlib
          >>> referenced by f32.rs:587 ([...]\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore\num\f32.rs:587)
          >>>               ab_glyph_rasterizer-30b5627c3ea89b5a.ab_glyph_rasterizer.nwt5n2v4-cgu.12.rcgu.o:(core::f32::_$LT$impl$u20$f32$GT$::max::h2b02c7db93eb7f14) in archive 

// ... trim ...

By the way, I'm using rusttype, which uses ab_glyph_rasterizer, which uses functions like floorf32. How can I fix the compilation (maybe I need to try Linux?).

Upvotes: 0

Views: 137

Answers (1)

sit
sit

Reputation: 360

Ok, I tried to use WSL to build my project and it seems to work. It's not ideal, but at least works.

Feel free to add better answers. :)

Upvotes: 1

Related Questions