AlexEne / AlexEne/rust_hawktracer_sys

Issues cross-compiling from Linux to Windows

オープン
#13 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
0
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

説明

I am cross-compiling from x86-64-unknown-linux-gnu to i686-pc-windows-gnu. Here are some issues I encountered:
- ```
/home/yalter/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_hawktracer_sys-0.4.2/hawktracer/lib/tcp_server.cpp:96:10: fatal error: WinSock2.h: No such file or directory
96 | #include
| ^~~~~~~~~~~~
```
```
/home/yalter/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_hawktracer_sys-0.4.2/hawktracer/lib/platform/windows/memory_usage.c:4:10: fatal error: Windows.h: No such file or directory
4 | #include
| ^~~~~~~~~~~
```
```
/home/yalter/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_hawktracer_sys-0.4.2/hawktracer/lib/platform/windows/memory_usage.c:5:10: fatal error: Psapi.h: No such file or directory
5 | #include
| ^~~~~~~~~
```
Fixed by making those includes all-lowercase.
- ```
cargo:rustc-link-search=all=/home/yalter/source/rs/bxt-rs/target/i686-pc-windows-gnu/debug/build/rust_hawktracer_sys-c9794263c9fe5873/out/build/lib/Debug
```
When using MinGW there's no additional `Debug`/`Release`/`RelWithDebInfo` folder in the end. Fixed by commenting out a line in `build.rs`.
- A lot of C++ linking errors. Fixed by copying the `println!("cargo:rustc-link-lib=dylib=stdc++");` line into the Windows branch as well. Although that made the built .dll require `libstdc++-6.dll` and a few other MinGW dlls; I couldn't change the line to say `static` because it couldn't find the static libstdc++ for some reason.

With those hack fixes in place, everything seemed to work fine.

I suspect these issues are specific to windows-gnu in general and not to just cross-compiling.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。