1

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?

3
  • Your distribution (or similar) would need to have a package for them if you wanted the static libraries to link against. Commented Apr 24, 2014 at 20:44
  • Will I be able to build it from source? Commented Apr 24, 2014 at 20:48
  • You certainly could build a copy of it from source. Whether you want to is the question. And, if you do, how that interacts with your system copy if you install it (or how you manage it as a general build detail if you don't). Commented Apr 24, 2014 at 20:50

1 Answer 1

6

I solved this on Linux/Macosx by installing libssl-dev.

sudo apt-get install libssl-dev 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.