Reputation: 930
gcc -o clxd -m64 -L/usr/local/lib64 -L/usr/lib64 -L/usr/lib64/nptl -Wl,-rpath,/home/y/lib64 -ldl -lrt -lpthread -lstdc++ -lgcc -lc -lm -lev -L/home/y/lib64 -Wl,-Bstatic -lboost_program_options -lboost_date_time -lboost_filesystem -lboost_regex -lboost_system -lboost_thread -llua -lcrypto -Wl,-Bdynamic -L/usr/lib
The above command is from a make file while executing make using V=1 (verbose) to understand if I have passed on directories properly or not. And it exits with the following error:
/usr/bin/ld: cannot find -lcrypto collect2: ld returned 1 exit status
My understanding from the gcc command, -Bstatic tries to statically link lib crypto (-lcrypto). When I checked under /usr/lib64, I have the following files:
libcrypto.so -> libcrypto.so.1.0.1e
libcrypto.so.10 -> libcrypto.so.1.0.1e
libcrypto.so.1.0.1e
Does -Bstatic link the shared files statically or not? If not how do I get libcrypto.a?
Upvotes: 1
Views: 8972
Reputation: 153
I solved this on Linux/Macosx by installing libssl-dev.
sudo apt-get install libssl-dev
Upvotes: 6