bytecodealliance / bytecodealliance/wasmtime
MSVC static linking issues since v29
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 121
Description
I just now updated my installation of Wasmtime from `wasmtime-v25.0.1-x86_64-windows-c-api` and I have linking problems starting from v29.0.0. Up to 28.0.1 my project that statically links to `wasmtime.lib` compiles without a warning, but starting with v29.0.0 and up to v32 I get these new warnings and errors:
```
1>Finished searching libraries
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Searching libraries
```
```
1>Finished searching libraries
1>LINK : warning LNK4217: symbol 'calloc' defined in 'libucrtd.lib(calloc.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_createCCtxParams'
1>LINK : warning LNK4286: symbol 'calloc' defined in 'libucrtd.lib(calloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)'
1>LINK : warning LNK4217: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_clearAllDicts'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-jitprofiling.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_ddict.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)'
1>LINK : warning LNK4217: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_CCtx_loadDictionary'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-jitprofiling.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_ddict.o)'
1>LINK : warning LNK4217: symbol 'strncpy_s' defined in 'libucrtd.lib(strncpy_s.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)' in function '__itt_domain_createA_init_3_0'
1>LINK : warning LNK4217: symbol 'strnlen' defined in 'libucrtd.lib(strnlen.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)' in function '__itt_domain_createA_init_3_0'
1>wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o) : error LNK2019: unresolved external symbol __imp__wcsdup referenced in function __itt_domain_createW_init_3_0
1>C:\msys\home\wahe\WAHE host lite\x64\Debug\wahe_host_lite.exe : fatal error LNK1120: 1 unresolved externals
```
It seems like it could be from the library being linked differently than before to a standard library, but I can't really tell what's wrong and everything I tried so far only created more problems or failed to resolve these. Looking at the January 2025 commits I can't see commits that would explain what changed either.
Contributor guide
Assessment
This issue has not been assessed yet.