简体   繁体   English

编译openssl失败,并显示“ / usr / bin / ld:找不到-lz”

[英]compile openssl fails with “/usr/bin/ld: cannot find -lz”

I'm trying to compile from source "openssl-1.0.1j" but fails with message: 我正在尝试从源代码“ openssl-1.0.1j”进行编译,但失败并显示以下消息:
"/usr/bin/ld: cannot find -lz" “ / usr / bin / ld:找不到-lz”

Environment is debian wheezy on raspberry pi. 环境在树莓派上是debian wheezy。

My files tree: 我的文件树:
├── zlib-1.2.8 ├──zlib-1.2.8
├ ├── lib sources ├├──lib资料来源
├ ├── libz.a ├├──libz.a

├── openssl-1.0.1j ├──openssl-1.0.1j
├ ├── lib sources ├├──lib资料来源

I compiled successfully zlib-1.2.8 as follow: 我成功编译了zlib-1.2.8,如下所示:

$ cd ~/zlib-1.2.8  
$ ./configure --static  
$ make test  

then tried to compile openssl -1.0.1j as follow: 然后尝试按以下方式编译openssl -1.0.1j:

$ cd ~/openssl-1.0.1j  
$ export CFLAGS="-I$HOME/zlib-1.2.8"  
$ export CPPFLAGS="-I$HOME/zlib-1.2.8"  
$ export LDFLAGS="-L$HOME/zlib-1.2.8"  
$ export LIBS="-l$HOME/zlib-1.2.8/libz.a"  
$ ./config threads zlib no-shared  
$ make  

I'm looking to get to files tree: 我正在寻找文件树:
├── zlib-1.2.8 ├──zlib-1.2.8
├ ├── lib sources ├├──lib资料来源
├ ├── libz.a ├├──libz.a

├── openssl-1.0.1j ├──openssl-1.0.1j
├ ├── lib sources ├├──lib资料来源
├ ├── libcrypto.a ├├──libcrypto.a
├ ├── libss.a ├├──libss.a

What am I missing? 我想念什么?

to config and compile openssl with static zlib (libz.a) 使用静态zlib(libz.a)配置和编译openssl

$ cd ~/openssl-1.0.1j
$ ./config threads no-shared zlib no-zlib-dynamic -L$HOME/zlib-1.2.8
$ make
$ make test

problem solved 问题解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM