Hi!
I'm trying to compile my project https://github.com/Leonti/rust-socket-server which uses tokio-serial library which in turn requires libudev and so far it fails with this error:
= note: /lib/x86_64-linux-gnu/libudev.so: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
These are the steps I performed before building (Ubuntu 18.10):
Add ~/.cargo/config with:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"libudev\"` did not exit successfully: exit code: 1\n--- stderr\nPackage libudev was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libudev.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'libudev\' found\n"', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
SYSROOT=/build/root doesn't seem right, any idea what should be in there?
How do people cross-compile for Raspberry Pi?
Feels like serial port is a pretty common feature, can't find anything on Google or forums.
I've been banging my head against the wall on this for a few days now and I don't know what to do at this point apart from copying the sources to Raspberry Pi and building it there
You mentioned serial ports. I wrote a serial port enumerator (a couple years ago) which doesn't depend on udev. Instead it uses the /sys filesystem to determine which ports are available. You can find it here: https://github.com/dhylands/serial-ports-rs
That's probably not what you want (now that I read the entire thread) - Sorry for the noise.
Hi @dhylands! Thanks for your response!
It will help me in the future since I can't use libudev and will probably need to enumerate ports at some point
Hello , I am new to rust and cross compilation, I have a pakage that depends on libudev, I was wondering by disabling libudev will there be any effect on my executable when I will be running it on raspberry pi. Thank you in advance