Build Problem: error: cannot find -lcrypto

2,985 views
Skip to first unread message

tcto

unread,
Aug 22, 2013, 10:55:56 PM8/22/13
to discuss...@googlegroups.com
Dear Group:

I am compiling the code as per instructions here: http://www.webrtc.org/reference/getting-started

When I finally get to compiling I am getting the following error:
$ ninja -C out/Debug peerconnection_server
ninja: Entering directory `out/Debug'
[1/1] LINK peerconnection_server
FAILED: g++ -Wl,-z,now -Wl,-z,relro -pthread -Wl,-z,noexecstack -fPIC -B../../third_party/gold -Wl,--threads -Wl,--thread-count=4 -Wl,--icf=none -o peerconnection_server -Wl,--start-group obj/talk/examples/peerconnection/server/peerconnection_server.data_socket.o obj/talk/examples/peerconnection/server/peerconnection_server.main.o obj/talk/examples/peerconnection/server/peerconnection_server.peer_channel.o obj/talk/examples/peerconnection/server/peerconnection_server.utils.o obj/talk/libjingle.a obj/third_party/openssl/libopenssl.a obj/third_party/jsoncpp/libjsoncpp.a  -Wl,--end-group -lcrypto -ldl -lrt -lXext -lX11 -lXcomposite -lXrender -lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lexpat
../../third_party/gold/gold64: error: cannot find -lcrypto
collect2: ld returned 1 exit status
ninja: build stopped: subcommand failed.

My libcrypto is here: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0

I am running Ubuntu 12.04.2 LTS on EC2.

uname -a shows this:  3.2.0-40-virtual #64-Ubuntu SMP Mon Mar 25 21:42:18 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I am not a Linux expert by any means so any help would be appreciated.

Sincerely,

tcto

tcto

unread,
Aug 23, 2013, 2:26:13 PM8/23/13
to discuss...@googlegroups.com
SOLVED: Answered my own question after several hours of Google search. My newbie-ness clearly showing. :-)

The issue was that the linker was looking for a file called libcrypto.so in /usr/lib. However, mine was called: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 and was not in /usr/lib.
The solution:
1) Find the libycrpto installed as follows: locate libcrypto mine resulted in this: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
2) Create a symbolic link in /usr/lib as follows: cd /usr/lib and then:  ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 libcrypto.so NOTE: If your libcrypto is somewhere else then change the path depending on what you get from the locate command.
3) Now you have a file called libcrypto.so in the /usr/lib directory and the linker should be happy, at least is was for me.
Reply all
Reply to author
Forward
0 new messages