0

我正在通过 rustup 使用夜间 Rust。我正在尝试为 GNU Octave 构建一个 Windows dll。是否可以使用 Octave 的 libstdc++.a?

我能够编译,但链接失败并出现以下错误

C:\Users\camer\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib/libstdc++.a(locale.o):(.text$_ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEy+0x2c): undefined reference to `pthread_mutex_lock'

C:\Users\camer\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib/libstdc++.a(locale.o):(.text$_ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEy+0xa7): undefined reference to `pthread_mutex_unlock'

C:\Users\camer\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib/libstdc++.a(locale.o):(.text$_ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEy+0xde): undefined reference to `pthread_mutex_init'

我目前的预感是libstdc++.a发现的不兼容。它使用以下搜索路径顺序从 Rust 中找到一个:

  1. "-L" "C:\Users\camer\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib"
  2. "-L" "C:\Octave\Octave-4.2.1\lib64\gcc\x86_64-w64-mingw32\4.9.4"

Octave 4.2.1 附带的 gcc 是 GCC 4.9.4 发布 [2016-08-03]。Rust nightly 发布了 GCC 6.3 [2016-12-21]。我是否需要使用 Octave 的 GCC 4.9.4 编译 Rust 标准库?那可能吗?本期的完整代码和更多详细信息。

4

0 回答 0