How do i dynamically link rusts stdlib?

what if i want to statically link rusts std lib to make the binary smaller? obviously wont be portable, just for experimental purposes.

if i cant do that, whats a good way to use other standard libraries like libc, or possibly even get c++ involved? if i wanna do no_std + windows, can i use windows-sys?
i meannn i guess im just using c with extra steps :skull:
anyway refer to my first question before this

what if i want to statically link rusts std lib to make the binary smaller? obviously wont be portable, just for experimental purposes.

statically?

if you want to dynamically link to stdlib, in your .cargo/config.toml:

# use dynamic libraries
[build]
rustflags = ["-C", "prefer-dynamic=yes"]

um, also doesn't "main" take up alot of bloat or something, what if i do that + no main, is that even possible :joy:

If you're trying to make the binary as small as possible, check out this guide:

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.