Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Rust application for Windows with cross and sqlite3 dependecy #676

Closed
buxx opened this issue Mar 28, 2022 · 2 comments
Closed

Compile Rust application for Windows with cross and sqlite3 dependecy #676

buxx opened this issue Mar 28, 2022 · 2 comments
Labels

Comments

@buxx
Copy link

buxx commented Mar 28, 2022

Hello !

I'm trying to compile my Rust application for Windows with cross. I got this error :

   Compiling trsync v0.1.3 (/project)
error: linking with `x86_64-w64-mingw32-gcc` failed: exit status: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o" "/target/x86_64-pc-windows-gnu/debug/deps/trsync-36594acb4f0db109.trsync.69d5ec1a-cgu.0.rcgu.o" [...] "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o"
  = note: /usr/bin/x86_64-w64-mingw32-ld: cannot find -lsqlite3
          collect2: error: ld returned 1 exit status
          

error: could not compile `trsync` due to previous error

How to compile my application for Windows with cross ?

@Emilgardis
Copy link
Member

Emilgardis commented Mar 28, 2022

Hi!

You'll need to provide a custom docker image that includes sqlite. See the readme
https://github.com/cross-rs/cross#custom-docker-images

Note that the example won't work right now as the latest tag has not been pushed to yet, use a specific sha or simply the main tag instead in the from step. Or use the old dockerhub images

Note that if you decide to compile cross from current main branch, be aware that it's currently broken on windows hosts pending #665. but compiling to windows should work fine

@DanielRivasMD
Copy link

Hi, I have a rather similar problem, and it is unclear which docker image I should use to compile. To be concrete: compile using cross from OSX to Windows with sqlite dependency. Much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants