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

Rustup vs Cargo binaries
How to redirect child process output to stderr?
Why does Rust not permit type inference for local constants?
How do I find the function pointers for tests from the LLVM IR code of a Rust program?
How to check in Rust if architecture is 32 or 64 bit?
How can I succinctly combine many `Result`s of different types?
Why is the produced assembly not equivalent between returning by reference and copy when inlined?
include module from the same directory level [duplicate]
Is there a way to prevent emitted LLVM IR from removing unused functions?
Does Cargo support custom profiles?
Pass mutable reference to an element of a vector as parameter of function alongside with that vector
How to format a String object in Rust? [duplicate]
How do I make rustc-link-search relative to the project location?
Safe non-trivial data dependencies/custom references?
Skip struct field when serializing
Rust error E0495 using split_at_mut in a closure

Categories

HOME
php
entity-framework
gaming
seedstack
d3.js
hdfs
odata
google-play-services
dronekit-python
haxe
angular-meteor
solution
heuristics
erd
ex
trace32
vertica
adobe-illustrator
angular2-highcharts
sqlplus
dashdb
pst
el
intel
ratio
firemonkey-style
unordered-multimap
plyr
hdmi
ninject
appcode
listjs
java-stream
bean-validation
cups
netstat
telephonymanager
ng-repeat
android-n
rdp
resampling
secure-coding
notesview
beeline
node-apn
sigsegv
line-intersection
dtd
pecl
perl-data-structures
yui3
ndk-build
data-management
clp
visual-studio-monaco
p6spy
always-on-top
oci
bbc-micro
qpixmap
unsigned
urbit
distributed-cache
gulp-uglify
android-expansion-files
miniconda
hmisc
search-form
compositetype
domino-designer-eclipse
swagger-maven-plugin
google-gdk
dbmigrate
tree-structure
deque
fuseesb
innerhtml
osascript
webautomation
git-reset
pageviews
property-injection
mod-perl
discovery
jquery-cycle
cgrectmake
jquery-dialog
towers-of-hanoi
gitx
popup-blocker
netstream
canonicalization
prism-2
remote-working

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App