Skip to content

Compile error in mimalloc 0.1.52 #173

Open

Description

@xBINj

System: Windows 11 Home 25H2, OS Version: 26200.9168
Visual Studio Build Tools Version: 18.10.0
cc version: 1.4.4
mimalloc version: 0.1.52
Cargo.toml config:
[dependencies]
mimalloc = "0.1"

Codes:
`
use mimalloc::MiMalloc;

#[global_allocator]
static GLOBAL_ALLOC: MiMalloc = MiMalloc;

fn main() {
test1_basic();
}

fn test1_basic() {
let mut v = Vec::with_capacity(1024);
v.push(666);
println!("v: {:?}", v);
}
`

In Visual Studio Code and I use cargo run or cargo build, it report the error below:

error: failed to run custom build command for libmimalloc-sys v0.1.49
Caused by:
process didn't exit successfully: C:\prjs_rust_git_src\rust_learning\mytest02\target\debug\build\libmimalloc-sys-3169b469e5474a5c\build-script-build (exit code: 1)
--- stderr

error occurred in cc-rs: command did not execute successfully (status code exit code: 2): "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-std:c++17" "-I" "c_src/mimalloc/v3/include" "-I" "c_src/mimalloc/v3/src" "-W4" "/Zc:__cplusplus" "-DMI_DEBUG=0" "-FoC:\prjs_rust_git_src\rust_learning\mytest02\target\debug\build\libmimalloc-sys-0b3f78552cb42b55\out\2a4e75ae9feb7516-mimalloc-static.o" "-c" "C:\prjs_rust_git_src\rust_learning\mytest02\target\debug\build\libmimalloc-sys-0b3f78552cb42b55\out\mimalloc-static.cc"

I looked for the file based on the error message and found that the file 2a4e75ae9feb7516-mimalloc-static.o is missing. But why?

Activity

  1. genusistimelord commented on Oct 19, 2026

    @genusistimelord

    I had this same issue as well to something that Was compiling just fine up until this week. could not figure out why even after repairing all the Tools used to compile it.

  2. xBINj commented on Oct 19, 2026

    @xBINj
    Author
    1. I had this same issue as well to something that Was compiling just fine up until this week. could not figure out why even after repairing all the Tools used to compile it.

    I am the same as you, my problem still exists. I found that the cc version used in mimalloc is 1.2, while the cc version in my own Rust project is 1.8.

  3. rtyler commented on Oct 21, 2026

    @rtyler

    You may have hit something similar to what I had hit,pinning to cc 1.8.0 worked fine for me. that may not be what @xBINj hit is the same since cc 1.9.0 broke my builds around mimalloc 🤷

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions