messense / mupdf-rs

Rust binding to mupdf
GNU Affero General Public License v3.0
109 stars 24 forks source link

I can't compile mupdf-rs on Windows 11 #73

Closed kusaanko closed 1 year ago

kusaanko commented 1 year ago

When I run cargo tauri dev on my project, I got this error.

Compiling mupdf-sys v0.4.2
error: failed to run custom build command for `mupdf-sys v0.4.2`

Caused by:
  process didn't exit successfully: `C:\Users\kusaanko\***\target\debug\build\mupdf-sys-9e5eebcec878fe08\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'Build error:
  STDERR:
  STDOUT:', C:\Users\kusaanko\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mupdf-sys-0.4.2\build.rs:330:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I found some font files are lost, so I put resources/fonts on https://github.com/ArtifexSoftware/mupdf in mupdf-sys-0.4.2/src. Then, I can run cargo tauri dev.

And I found these font files are excluded in Cargo.toml

[package]
edition = "2018"
name = "mupdf-sys"
version = "0.4.2"
authors = ["messense <messense@icloud.com>"]
links = "mupdf-wrapper"
exclude = [
    "mupdf/resources/cmaps/*",
    "mupdf/resources/icc/*",
    "mupdf/resources/fonts/droid/*",
    "mupdf/resources/fonts/han/*",
    "mupdf/resources/fonts/noto/*",
    "mupdf/resources/fonts/sil/*",
    "mupdf/resources/fonts/urw/input/*",

When I build libresources using Visual Studio 2022, I got this error(sorry for Japanese)

重大度レベル  コード 説明  プロジェクト  ファイル    行   抑制状態
エラー MSB3721 コマンド "Release\bin2coff.exe "C:\Users\kusaanko\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mupdf-sys-0.4.2\mupdf\resources\fonts\droid\DroidSansFallback.ttf" "x64\Release\libresources\DroidSansFallback_ttf.obj" _binary_DroidSansFallback_ttf x64" はコード 1 で終了しました。   libresources    C:\Users\kusaanko\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mupdf-sys-0.4.2\mupdf\platform\win32\bin2coff.targets    76  

I can compile mupdf-rs on macOS without any changes.

kusaanko commented 1 year ago

Same to #72 I'll move to #72.