rust


Why doesn't the rust crate openssl-sys compile?


I've just added an external crate to my Rust project:
[dependencies]
feed = "2.0"
This crate has several dependencies, notably openssl-sys v0.9.10. This one failed when I'm trying to build my project:
$ cargo build
Compiling unicode-normalization v0.1.4
Compiling openssl-probe v0.1.0
Compiling matches v0.1.4
Compiling log v0.3.7
Compiling unicode-bidi v0.2.5
Compiling libc v0.2.21
Compiling quick-xml v0.4.2
Compiling pkg-config v0.3.9
Compiling rss v0.4.0
Compiling idna v0.1.1
Compiling time v0.1.36
Compiling num-traits v0.1.37
Compiling gcc v0.3.45
Compiling num-integer v0.1.34
Compiling url v1.4.0
Compiling num-iter v0.1.33
Compiling num v0.1.37
Compiling chrono v0.3.0
Compiling openssl-sys v0.9.10
Compiling libz-sys v1.0.13
error: failed to run custom build command for `openssl-sys v0.9.10`
process didn't exit successfully:
`/home/E3news/flux/target/debug/build/openssl-sys-223aa532c32a251f/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Failed to run `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`: No such file or directory (os error 2)"', /buildslave/rust-
buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:868
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Build failed, waiting for other jobs to finish...
error: build failed
I'm on a Debian 8.7 and I use Rust 1.16. I tried a fix by installing libssl-dev on my OS but it doesn't fix the issue.
Any idea?
From the comments:
Have you installed pkg-config and openssl?
Yes it works! openssl was already installed but not pkg-config. So:
$ apt install pkg-config
$ cargo clean
$ cargo build
solved my problem. Thank you #kennytm!

Related Links

How do I access the data sent over UDP?
How to idiomatically copy a slice?
Recursive types and arrays
Can I determine the zero value of generic types?
How to slice a large Vec<i32> as &[u8]?
How to parse i64 from a string? [duplicate]
Why is variable scope dependent on the definition order?
Warning on “unstable” directive
How can I pass a socket as an argument to a function being called within a thread?
error: cannot move out of borrowed content on &mut self
Why does a reference not live long enough in case of “as_slice”?
Getting the error “error: the trait `core::marker::Sized` is not implemented” when trying to return the value from a vector
Traits with associated type in templates
Error handling best-practices
How to call count on an iterator and still use the iterator's items?
Caught between a lifetime and an FFI place

Categories

HOME
oracle
extjs
yaml
magento-2.0
fogbugz
navigation
onvif
sympy
anchor
android-externalstorage
sslhandshakeexception
outlook-restapi
synthesis
asciimath
xsl-fo
codefluent
deepfreeze
adobe-illustrator
clr
weex
maven-surefire-plugin
sybase-ase
webviewclient
spreadsheetgear
android-cardview
uilocalnotification
tortoisehg
code-climate
autodesk-model-derivative
instructions
quick-nimble
counting
char-pointer
rails-postgresql
cordys-opentext
love2d
mv
elasticsearch-aggregation
git-tfs
asihttprequest
section508
rm
photoswipe
node-apn
embedded-v8
webvtt
glimpse
front-camera
adobe-reader
d3v4
ternary-operator
bigdecimal
tablespace
zynq
seccomp
groovyfx
android-syncadapter
juniper-network-connect
opencyc
ora-04091
knife
alwayson
fat32
famo.us
smacss
accessory
forceclose
bittorrent-sync
armv6
san
mongo-jackson-mapper
oembed
smartfox
getopt-long
msinfo32
kaazing
servercontrol
boost-foreach
haiku
getopts
eventaggregator
google-translator-toolkit
gtktextview
database-cloning
error-detection
account-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App