I have been working through the asio ssl examples (linked below). Despite by best efforts I have been unable to link openssl into the boost example. The output from ld is that ld is missing symbols from libssl.a. The thing that I can not figure out is that I found all the symbols in libssl.a with nm that ld says are missing. I suspect I am doing something dumb but I am not familiar enough with c++ to fix it. I have also included my makefile. The source of ssl-client.cpp is verbatim from the link.
http://www.boost.org/doc/libs/1_41_0/doc/html/boost_asio/example/ssl/client.cpp
INCLUDES = -I /usr/local/boost_1_41_0/ -I /opt/local/include/
LIBS = -L/usr/local/boost_1_41_0/lib/libboost_system.a \
-L/opt/local/lib/libcrypto.a \
-L/opt/local/lib/libssl.a
CPP = g++
build: ssl-client
ssl-client: ssl-client.cpp
$(CPP) $(LIBS) $(INCLUDES) ssl-client.cpp
I think you've misunderstood how the
-L
option works.-L
specifies a path in which to search for libraries. To specify an individual library to link to, use the-l
option and omit the "lib" prefix, as follows:Also, there is usually no space between the
-I
include path option and the actual path. I'm not sure if a space in there causes problems, but you might try this to be on the safe side:Also, as noted in my comment, you defined the
LIBS
variable but then used theLIB
variable. The call to g++ should be as follows: