简体   繁体   中英

Why does 'apt-file list' list *.so files that arn't on the host? And which one do I link to?

I've ran the following command to list the openssl library files on disk:

apt-file list libssl-dev

And got the output:

(a long list of *.h files)  
libssl-dev: /usr/lib/x86_64-linux-gnu/libcrypto.a
libssl-dev: /usr/lib/x86_64-linux-gnu/libcrypto.so
libssl-dev: /usr/lib/x86_64-linux-gnu/libssl.a
libssl-dev: /usr/lib/x86_64-linux-gnu/libssl.so
(.pc, .gz and others)

But the libssl.a and libssl.so arn't on the disk.

ls -l /usr/lib/x86_64-linux-gnu/libssl*

Gives this output:

-rw-r--r-- 1 root root 328128 Feb  5  2018 /usr/lib/x86_64-linux-gnu/libssl3.so
-rw-r--r-- 1 root root 426232 Jun 20 05:00 /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
-rw-r--r-- 1 root root 433760 Jun 20 04:29 /usr/lib/x86_64-linux-gnu/libssl.so.1.1

So how do I link to the ssl library in my C++ applications? When I specify -llibssl.so, I get an error telling me its not found.

If I'm supposed to pick one of the existing files on disk, which one do I pick and what criteria do I use?

I'm using Ubuntu 18.04.

只需安装开发包sudo apt install libssl-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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