首页 文章

致命错误:openssl / e_os2.h:没有这样的文件或目录

提问于
浏览
2

从链接下载带有SSL / TLS库的SMTP客户端:[https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS][1] .

在我的Netbeans项目“Header Files”文件夹中包含了CSmtp.h文件,该文件消除了main.cpp文件的错误 .

在将“openssl”文件夹添加到netbeans项目目录的根目录之前,我收到了“致命错误:openssl \ ssl.h:没有这样的文件或目录”的编译错误 .

现在添加“openssl”文件夹后,我收到错误:

致命错误:openssl / e_os2.h:没有这样的文件或目录

Netbeans控制台出错:

CLEAN SUCCESSFUL (total time: 1s)
cd 'C:\Users\Nicholas1\Documents\NetBeansProjects\DemoCppEmail'
C:\cygwin64\bin\make.exe -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Nicholas1/Documents/NetBeansProjects/DemoCppEmail'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/democppemail.exe
make[2]: Entering directory '/cygdrive/c/Users/Nicholas1/Documents/NetBeansProjects/DemoCppEmail'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
g++    -c -g -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.cpp
In file included from CSmtp.h:52:0,
                 from main.cpp:1:
openssl\ssl.h:173:27: fatal error: openssl/e_os2.h: No such file or directory
 #include <openssl/e_os2.h>
                           ^
compilation terminated.
make[2]: *** [nbproject/Makefile-Debug.mk:68: build/Debug/Cygwin-Windows/main.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Nicholas1/Documents/NetBeansProjects/DemoCppEmail'
make[1]: *** [nbproject/Makefile-Debug.mk:59: .build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Nicholas1/Documents/NetBeansProjects/DemoCppEmail'
make: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2

BUILD FAILED (exit value 2, total time: 10s)

我的解释是编译器能够找到“CSmtp.h”包含,“openssl / ssl.h”包含,但无法解析“openssl / e_os2.h” . 不知道为什么编译器无法解析“e_os2.h”,因为在openssl文件夹中找到ssl.h以及“e_os2.h” . 非常感谢您对此编译器错误的专家建议 .

1 回答

  • 0

    首先必须确保openssl文件夹(包含所有.h文件的文件夹 . 在openssl-0.9.8l \ inc32中找到)位于CodeProject实现(CSmtp_v2_4_ssl.zip)的“main.cpp”范围内 . 接下来编辑“ssl.h”文件;现在找到声明

    #include <openssl\e_os2.h>
    

    改成

    #include "openssl\e_os2.h"
    

    将括号替换为每个“无此目录”错误,该错误对目录存在是错误的 .

相关问题