Cross compile on Windows to Raspberry 3 (with Reqwest that uses open ssl)

Hello,
I want to cross-compile my rust app that uses Reqwest to raspberry 3. I have installed to toolchain to compile but the compiler tells me that OpenSSL or LibSSL needs to be installed!
Have you an idea on how to do that since I am on windows.

Thanks for your help.

In my experience, it's usually more trouble than it's worth to cross-compile stuff that requires C dependencies across OSes. I'd recommend you setup a Linux VM (perhaps using WSL2 if that's already out) and then building using cross, while keeping in mind that unfortunately openssl requires some extra setup.

Alternatively, if your use case does not absolutely require openssl I'd also look into compiling reqwest with the rustls feature instead of openssl to avoid the C dependency and toolchain wrangling. Then you should be able to build with the regular --target option.

I doesn't use the open ssl feature only http requests. How can I completely disable ssl from reqwest?

Declare the reqwest dependency in Cargo.toml like so: reqwest = { version = "0.10", default-features = false, features = ["blocking", "json"] }. Add/remove features you need accordingly, see https://docs.rs/reqwest/0.10.6/reqwest/#optional-features for a list.

thread '' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Request, url: "http://www.example.com", source: hyper::Error(Connect, "invalid URL, scheme is not
http") }', src\query.rs:106:242

That's strange, I can't seem to reproduce that error. Here's how I try it:

Cargo.toml:

[package]
name = "repro"
version = "0.1.0"
authors = ["casept <davids.paskevics@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
reqwest = { version = "0.10", default-features = false, features = ["blocking", "json"] }

main.rs:

fn main() {
	let body = reqwest::blocking::get("http://www.example.com").unwrap()
    	.text().unwrap();
    println!("body = {:?}", body);
}

I seem to get a correct response. Can you post the exact code you're using?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.