ITADN

Windows x86_64 Build error

#120Openjiabochao 创建于 2025-11-01
bug
J
jiabochaocommented
### What happened? Hi, when I compile on Windows using the `tts` and `static` features, I get the following compilation error. - Cargo.toml ``` [target.'cfg(all(target_os = "windows", target_arch = "x86_64"))'.dependencies] sherpa-rs = {version = "0.6.6", default-features = false, features = ["static", "tts"] } ``` Windows build error: ``` error: linking with `link.exe` failed: exit code: 1120 | = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\link.exe" "/DEF:C:\\Users\\jiabo\\AppData\\Local\\Temp\\rustc90FBtn\\lib.def" "/NOLOGO" "C:\\Users\\jiabo\\AppData\\Local\\Temp\\rustc90FBtn\\symbols.o" "<8 object files omitted>" "C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\deps/{libhound-c752ff8e59781799.rlib,libtracing-8a08043f2e2d78cd.rlib,liblog-59e9d4c1fb2c1e03.rlib,libvalue_bag-10ffffe02512a26b.rlib,libpin_project_lite-c2856b841f2f0624.rlib,libtracing_core-35fc013f58ada033.rlib,libsherpa_rs_sys-01736de1bd398957.rlib,libeyre-de594ed5492cee35.rlib,libindenter-e2253027d41c44c8.rlib,libonce_cell-47fad646ee02dfb9.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "msvcrtd.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\build\\sherpa-rs-sys-f0b8fb31b9194152\\out" "/LIBPATH:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\build\\sherpa-rs-sys-f0b8fb31b9194152\\out\\lib" "/OUT:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\deps\\sherpa_rs-ae60a1712356d545.dll" "/OPT:REF,NOICF" "/DLL" "/IMPLIB:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\deps\\sherpa_rs-ae60a1712356d545.dll.lib" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libstd.natvis" = note: some arguments are omitted. use `--verbose` to show all linker arguments = note: Creating library C:\Users\jiabo\projects\eff\src-tauri\target\debug\deps\sherpa_rs-ae60a1712356d545.dll.lib and object C:\Users\jiabo\projects\eff\src-tauri\target\debug\deps\sherpa_rs-ae60a1712356d545.dll.exp␍ LINK : warning LNK4098: defaultlib 'msvcrt' conflicts with use of other libs; use /NODEFAULTLIB:library␍ LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library␍ libsherpa_rs_sys-01736de1bd398957.rlib(provider_registration.obj) : error LNK2019: unresolved external symbol __imp_EventWriteTransfer referenced in function "struct OrtStatus * __cdecl OrtApis::SessionOptionsAppendExecutionProvider(struct OrtSessionOptions *,char const *,char const * const *,char const * const *,unsigned __int64)" (?SessionOptionsAppendExecutionProvider@OrtApis@@YAPEAUOrtStatus@@PEAUOrtSessionOptions@@PEBDPEBQEBD2_K@Z)␍ libsherpa_rs_sys-01736de1bd398957.rlib(inference_session.obj) : error LNK2001: unresolved external symbol __imp_EventWriteTransfer␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2001: unresolved external symbol __imp_EventWriteTransfer␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventWriteTransfer␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventRegister referenced in function "public: __cdecl onnxruntime::WindowsTelemetry::WindowsTelemetry(void)" (??0WindowsTelemetry@onnxruntime@@QEAA@XZ)␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventRegister␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventUnregister referenced in function "public: virtual __cdecl onnxruntime::WindowsTelemetry::~WindowsTelemetry(void)" (??1WindowsTelemetry@onnxruntime@@UEAA@XZ)␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventUnregister␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventSetInformation referenced in function "public: __cdecl onnxruntime::WindowsTelemetry::WindowsTelemetry(void)" (??0WindowsTelemetry@onnxruntime@@QEAA@XZ)␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventSetInformation␍ libsherpa_rs_sys-01736de1bd398957.rlib(speech.obj) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExA referenced in function espeak_ng_InitializePath␍ libsherpa_rs_sys-01736de1bd398957.rlib(speech.obj) : error LNK2019: unresolved external symbol __imp_RegQueryValueExA referenced in function espeak_ng_InitializePath␍ ``` ### Steps to reproduce cargo build ### What OS are you seeing the problem on? Window ### Relevant log output ```shell error: linking with `link.exe` failed: exit code: 1120 | = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\link.exe" "/DEF:C:\\Users\\jiabo\\AppData\\Local\\Temp\\rustc90FBtn\\lib.def" "/NOLOGO" "C:\\Users\\jiabo\\AppData\\Local\\Temp\\rustc90FBtn\\symbols.o" "<8 object files omitted>" "C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\deps/{libhound-c752ff8e59781799.rlib,libtracing-8a08043f2e2d78cd.rlib,liblog-59e9d4c1fb2c1e03.rlib,libvalue_bag-10ffffe02512a26b.rlib,libpin_project_lite-c2856b841f2f0624.rlib,libtracing_core-35fc013f58ada033.rlib,libsherpa_rs_sys-01736de1bd398957.rlib,libeyre-de594ed5492cee35.rlib,libindenter-e2253027d41c44c8.rlib,libonce_cell-47fad646ee02dfb9.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "msvcrtd.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\build\\sherpa-rs-sys-f0b8fb31b9194152\\out" "/LIBPATH:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\build\\sherpa-rs-sys-f0b8fb31b9194152\\out\\lib" "/OUT:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\deps\\sherpa_rs-ae60a1712356d545.dll" "/OPT:REF,NOICF" "/DLL" "/IMPLIB:C:\\Users\\jiabo\\projects\\eff\\src-tauri\\target\\debug\\deps\\sherpa_rs-ae60a1712356d545.dll.lib" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libstd.natvis" = note: some arguments are omitted. use `--verbose` to show all linker arguments = note: Creating library C:\Users\jiabo\projects\eff\src-tauri\target\debug\deps\sherpa_rs-ae60a1712356d545.dll.lib and object C:\Users\jiabo\projects\eff\src-tauri\target\debug\deps\sherpa_rs-ae60a1712356d545.dll.exp␍ LINK : warning LNK4098: defaultlib 'msvcrt' conflicts with use of other libs; use /NODEFAULTLIB:library␍ LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library␍ libsherpa_rs_sys-01736de1bd398957.rlib(provider_registration.obj) : error LNK2019: unresolved external symbol __imp_EventWriteTransfer referenced in function "struct OrtStatus * __cdecl OrtApis::SessionOptionsAppendExecutionProvider(struct OrtSessionOptions *,char const *,char const * const *,char const * const *,unsigned __int64)" (?SessionOptionsAppendExecutionProvider@OrtApis@@YAPEAUOrtStatus@@PEAUOrtSessionOptions@@PEBDPEBQEBD2_K@Z)␍ libsherpa_rs_sys-01736de1bd398957.rlib(inference_session.obj) : error LNK2001: unresolved external symbol __imp_EventWriteTransfer␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2001: unresolved external symbol __imp_EventWriteTransfer␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventWriteTransfer␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventRegister referenced in function "public: __cdecl onnxruntime::WindowsTelemetry::WindowsTelemetry(void)" (??0WindowsTelemetry@onnxruntime@@QEAA@XZ)␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventRegister␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventUnregister referenced in function "public: virtual __cdecl onnxruntime::WindowsTelemetry::~WindowsTelemetry(void)" (??1WindowsTelemetry@onnxruntime@@UEAA@XZ)␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventUnregister␍ libsherpa_rs_sys-01736de1bd398957.rlib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventSetInformation referenced in function "public: __cdecl onnxruntime::WindowsTelemetry::WindowsTelemetry(void)" (??0WindowsTelemetry@onnxruntime@@QEAA@XZ)␍ libsherpa_rs_sys-01736de1bd398957.rlib(etw_sink.obj) : error LNK2001: unresolved external symbol __imp_EventSetInformation␍ libsherpa_rs_sys-01736de1bd398957.rlib(speech.obj) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExA referenced in function espeak_ng_InitializePath␍ libsherpa_rs_sys-01736de1bd398957.rlib(speech.obj) : error LNK2019: unresolved external symbol __imp_RegQueryValueExA referenced in function espeak_ng_InitializePath␍ ```
0 条评论