-
Notifications
You must be signed in to change notification settings - Fork 381
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
ncurses.h: No such file or directory #1343
Comments
Hi! First up, targeting The main issue you're encountering stems from To fix this, you'll want to set up a # Cross.toml
[build]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libncurses-dev:$CROSS_DEB_ARCH"
] This will install the necessary library in the container for whichever target you're using, see As for
If you have more questions, feel free to ask. |
Thanks for the detailed explanation and the clear guide how to proceed, will try it next! I'm unsure if powerpc64le is the right architecture for my target system, it's an OpenWRT device with a Freescale MPC85xx P1014 SoC, which I believe is a 32bit PowerPC architecture, but I'm not sure. I'll try with powerpc64le-unknown-linux-gnu in a few hours and report back on my results afterwards :) |
Okey, so first result, the ncurses.h not found vanished, but it still fails, but I don't understand what the new error is trying to say:
|
okey, so next I've tried this:
which worked fine. So my problems are related to the lesser used cpu architecture targets... |
okey, so now I found that if I replace my code which was the most basic sample from the Cursive CUI library with a simple So the problem seem to be specific to ncurses (or it's dependencies?) which are used by the Cursive CUI library when compiling for a powerpc archetecture. |
okey, but copying the resulting binary to my openwrt device and running it there doesn't print the string passed to the println macro, but instead:
|
ah, so after reading this: https://stackoverflow.com/questions/31385121/elf-file-exists-in-usr-bin-but-turns-out-ash-file-not-found I believe I got differing versions of libc between the build container and the openwrt device, and the build has dynamically linked to that libc present during building. OpenWRT:
|
The error you're getting when building ncurses is the same as jeaye/ncurses-rs#184 I'd say what ncurses-rs is doing here is a bit iffy. It compiles using the target cc, and tries to run it.It does then seem like this is not a cross issue, but a general cross-compilation issue for the ncurses crate. I do know a way to fix this for users of cross (and more) maybe, utilize the runner thats been specified here. Ill see if i can get a fix up for that crate. Also, you are correct, MPC8540 is powerpc, not ppc64el |
There we go, adding [patch.crates-io]
ncurses = { git = "https://github.com/Emilgardis/ncurses-rs", branch = "fix-runner" } should fix the issue. Interestingly, I couldn't reproduce the exec error on windows, not sure why :3 as for powerpc, I'm not able to use debian ports nor jessie to install libncurses-dev, something in the repo is fundamentally broken. I'm not sure how to proceed except for maybe to not use ncurses and instead use something rust native like ratatui |
wow, amazing how much effort you put into solving anonymous peoples problems, thank you for being an amazing human beeing ❤️ For getting to a running binary faster I already downgraded my sample from using Cursive (CUI lib) which is using ncurses, to a only std rust using prtinln!("hello world") - but still failed because of the very old libc version on my OpenWRT router. Can you help me with that also? Should I create a separate issue for this? I've so far documented my research on that problem here: https://users.rust-lang.org/t/compile-rust-for-powerpc-openwrt-device-with-libc-1-2-3/101147/ |
Checklist
Describe your issue
I tried building my almost empty Rust + Cursive playground application, and failed:
This error says I'm missng ncurses.h, but I'm not:
What target(s) are you cross-compiling for?
powerpc-unknown-linux-gnu
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.5 (3c21f9e 2023-10-11)
Example
git clone https://gitlab.com/thomas351/rust-p2p-chat/ cd rust-p2p-chat cross build --release
Gives the error message
/target/x86_64-unknown-linux-gnu/release/build/ncurses-e7af6b71caf2e572/out/chtype_size.c:6:10: fatal error: ncurses.h: No such file or directory
Additional information / notes
The normal
cargo build --release
works fine.The text was updated successfully, but these errors were encountered: