-
Notifications
You must be signed in to change notification settings - Fork 778
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
Error: linking with `x86_64-w64-mingw32-gcc #1624
Comments
Hi @jdaruja, |
Thank you for the reply.
/usr/bin/x86_64-w64-mingw32-ld: /home/justin/Justin/Project/Rust/Test/cross_compile/target/x86_64-pc-windows-gnu/release/deps/libpyo3-c9b07f3a6e14168d.rlib(pyo3-c9b07f3a6e14168d.pyo3.azeiam2y-cgu.9.rcgu.o):pyo3.azeiam2y-cgu.:(.text+0x858): undefined reference to
error: aborting due to previous error; 2 warnings emitted error: could not compile Caused by: |
this doesn't look quite right. That looks like a path on your host OS, rather than inside the Dockerfile. Can you double-check that you're invoking |
I suspect this might have been fixed in #1759. Please report and we can reopen if there are still issues. |
🐛 Bug Reports
When reporting a bug, please provide the following information. If this is not a bug report you can just discard this template.
🌍 Environment
💥 Reproducing
Please provide a minimal working example. This means both the Rust code and the Python.
lib.rs
use pyo3::prelude::;
use pyo3::wrap_pyfunction;
use std::fs::File;
use std::io::prelude::;
use std::path::Path;
#[allow(unused_parens)]
#[pyfunction]
/// Returns the file
fn return_file(a: String) -> PyResult {
let mut f = File::open(a)?;
let mut contents = String::new();
f.read_to_string(&mut contents)?;
Ok((contents))
}
/// This module is a python module implemented in Rust.
///
#[pymodule]
fn cross_compile(py: Python, m: &PyModule) -> PyResult<()> {
m.add_wrapped(wrap_pyfunction!(return_file))?;
Ok(())
}
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
ar = "x86_64-w64-mingw32-gcc-ar"
Please also write what exact flags are required to reproduce your results.
When I cross build using - cross-rs/cross#556 instructions (Embedded/Rust)
from Ubuntu to windows
using command
cross build --target x86_64-pc-windows-gnu
get error
error: linking with
x86_64-w64-mingw32-gcc
failed: exit code: 1note: /usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpython3.8
collect2: error: ld returned 1 exit status
error: aborting due to previous error;
Please help
The text was updated successfully, but these errors were encountered: