Can't link OpenSSL code

前端 未结 2 1513
轻奢々
轻奢々 2020-12-11 05:52

I am trying to build an openssl simple program. Here is the complete code:

#include 
#include 
#include 
#incl         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 06:41

    You may be trying to statically link, but the -L option and -lcrypto are looking for a file to link with dynamically. To statically link to a specific library, just specify your .a file on the compiler command line after all your source files.

    E.g.,

    gcc -I/home/aleksei/openSSL0.9.8/include -o app tema1.c ./libcrypto.a
    

提交回复
热议问题