Skip to content

unresolved external symbol __mi_msvc_initu when compiling for ARM64 in Visual Studio 2019 #426

Closed
@mojca

Description

@mojca

When compiling software with Visual Studio 2019 for ARM64, the linker fails with

mimalloc.lib(init.obj) : error LNK2001: unresolved external symbol __mi_msvc_initu
myprogram.exe : fatal error LNK1120: 1 unresolved externals

By replacing

-#ifdef _M_X64
+#if defined(_M_X64) || defined(_M_ARM64)

in

mimalloc/src/init.c

Lines 572 to 577 in 076f815

#ifdef _M_X64
__pragma(comment(linker, "/include:" "_mi_msvc_initu"))
#pragma section(".CRT$XIU", long, read)
#else
__pragma(comment(linker, "/include:" "__mi_msvc_initu"))
#endif

it seems to work, but please note that I neither understand the code nor possess the hardware capable of running the resulting binary.

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