purpleprotocol / mimalloc_rust

A Rust wrapper over Microsoft's MiMalloc memory allocator
MIT License
481 stars 42 forks source link

link.exe error #80

Open CKingX opened 2 years ago

CKingX commented 2 years ago

I tried using mimalloc version 0.1.29 with default features off (to turn secure mode off). It resulted in link.exe error

error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX64\\x64\\link.exe" "/N **SKIPPING A WHOLE BUNCH OF TEXT UNTIL ERROR**
IS:C:\\Users\\chira\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
          LINK : warning LNK4217: symbol '_errno' defined in 'libucrt.lib(errno.obj)' is imported by 'liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o)' in function '_mi_arena_alloc_aligned'
          LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o)' in function '_mi_fputs'
          LINK : warning LNK4217: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o)' in function 'mi_vfprintf'
          LINK : warning LNK4217: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o)' in function 'mi_new_aligned'
          liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o) : error LNK2019: unresolved external symbol __imp_toupper referenced in function mi_option_init
          liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o) : error LNK2019: unresolved external symbol __imp__wgetenv referenced in function mi_wdupenv_s
          liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o) : error LNK2019: unresolved external symbol __imp_strtol referenced in function mi_option_init
          liblibmimalloc_sys-e220b0a3f2609271.rlib(static.o) : error LNK2019: unresolved external symbol __imp_getenv referenced in function mi_dupenv_s
          C:\Users\chira\Downloads\hibp\target\release\deps\haveibeenpwned.exe : fatal error LNK1120: 4 unresolved externals

I have uninstalled C++ Visual Build tools 2019 and replaced it with C++ Visual Build tools 2022 but it made no difference. These were the settings in Visual Build tools installer image