我已经在C中启动了一个项目,需要实现一些openssl库 . 我下载了这些库,按照如何安装openssl的说明进行操作 .

这是一个痛苦,并且由于多种原因不得不多次安装/重新安装 .

我终于能够看似正确安装openssl并编译库,用-libcrypto和-libssl链接它们而不是-lcrypto和-lssl我到处都看到了 .

我已经完成了调试过程,我的包含很好,并且implimentation似乎工作,因为g找到错误文件并抛出编译错误,但当它“成功”编译并运行.exe时我得到此错误 .

enter image description here

I have searched my openssl intall location and i did find that file.

enter image description here

Here is my makefile code, all those location are clearly in the building path

# *- Makefile -*

compiler=g++
standLib=-lstdc++ -llibcrypto -llibssl
include=-I C:\openssl-1.1.0e\include 
ExtLibrary=-L C:\openssl-1.1.0e        // <--- LOCATION OF THE .dll FILE
outfile=-o main.exe

all : main.o fileReader.o main

clean :
    del *.o *.exe

main: main.o fileReader.o numbers.o
    $(compiler) main.o $(standLib) $(include) $(ExtLibrary) $(outfile)

main.o : main.cpp fileReader.cpp
    $(compiler) -c main.cpp $(standLib) $(include) $(ExtLibrary) 

fileReader.o : fileReader.cpp fileReader.h
    $(compiler) -c fileReader.cpp $(standLib) 

numbers.o : numbers.cpp numbers.h
    $(compiler) -c numbers.cpp $(standlib)

What am i missing ? Thanks for any input or help !

更新

我发现只要它运行在与libcrypto-1_1-x64.dll所在的openssl相同的目录中,我就可以执行我的程序 .

我如何构建我的程序,以便它可以自己运行它而无需在计算机上安装openssl? IE:如果我想把它交给一个朋友,他的机器上没有安装openssl .