Skip to main content

Crt

Enum Crt 

Source
pub enum Crt {
    Static,
    Dll,
}
Expand description

Which of Microsoft’s two C runtimes a program in the MSVC environment is linked against.

cl.exe spells the choice /MT and /MD, and here it is -fms-runtime-lib=static and -fms-runtime-lib=dll, which is clang’s spelling. Two sets of libraries and two macros: the headers read _MT for both and _DLL only for the second, and that is how a header knows its functions are imported from a DLL rather than linked into the program.

The static one is the default, which is the opposite of cl.exe, and the reason is the machine the program is copied to. The universal CRT is part of Windows 10 and later, but the Visual C++ runtime is not: vcruntime140.dll arrives with the redistributable, and a program linked /MD on a machine that never installed it does not start. A program linked /MT carries both and starts anywhere, which is what the mingw-w64 rows give without being asked.

Variants§

§

Static

/MT: libcmt.lib, libucrt.lib and libvcruntime.lib, all three linked into the program.

§

Dll

/MD: msvcrt.lib, ucrt.lib and vcruntime.lib, which are import libraries for ucrtbase.dll and vcruntime140.dll with the startup code in the first of them.

Trait Implementations§

Source§

impl Clone for Crt

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Crt

Source§

impl Debug for Crt

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Crt

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Crt

Source§

impl PartialEq for Crt

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Crt

Auto Trait Implementations§

§

impl Freeze for Crt

§

impl RefUnwindSafe for Crt

§

impl Send for Crt

§

impl Sync for Crt

§

impl Unpin for Crt

§

impl UnsafeUnpin for Crt

§

impl UnwindSafe for Crt

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.