致命错误:openssl/e_os2.h:没有这样的文件或目录 [英] fatal error: openssl/e_os2.h: No such file or directory
问题描述
从以下链接下载了带有SSL/TLS库的SMTP客户端:[ https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS] [1] .
Downloaded the SMTP Client with SSL/TLS library from link: [https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS][1].
在我的Netbeans项目"Header Files"文件夹中包含CSmtp.h文件,该文件消除了main.cpp文件的错误.
Included the CSmtp.h file in my Netbeans project "Header Files" folder, which gets rid of error for the main.cpp file.
在将"openssl"文件夹添加到netbeans项目目录的根目录之前,出现了致命错误:openssl \ ssl.h:没有这样的文件或目录"的编译错误.
I got the compilation error of "fatal error: openssl\ssl.h: No such file or directory" before adding the "openssl" folder to root of netbeans project directory.
现在添加"openssl"文件夹后,出现错误:
Now after adding the "openssl" folder, I am getting the error:
严重错误:openssl/e_os2.h:没有这样的文件或目录
fatal error: openssl/e_os2.h: No such file or directory
Netbeans控制台中的错误:
Error in Netbeans Console:
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",因为在ssl.h和"e_os2.h"中都找到了ssl.h.您对于此编译器错误的专家建议将不胜感激.
My interpretation is that the compiler is able to find the "CSmtp.h" include, "openssl/ssl.h" include, but cannot resolve "openssl/e_os2.h". Not sure why the compiler cannot resolve "e_os2.h" since ssl.h is found in the openssl folder along with "e_os2.h". Your expert advice to this compiler error will be greatly appreciated.
推荐答案
首先必须确保openssl文件夹(包含所有.h文件的文件夹.在openssl-0.9.8l \ inc32中找到)属于主要"文件的范围. cpp"(来自CodeProject实现(CSmtp_v2_4_ssl.zip).接下来编辑"ssl.h"文件;现在找到声明
Firstly had to ensure openssl folder(folder with all .h files. found in openssl-0.9.8l\inc32) was in the scope of the "main.cpp" from the CodeProject implementation(CSmtp_v2_4_ssl.zip). Next edit the "ssl.h" file; now locate the declaration
#include <openssl\e_os2.h>
更改为
#include "openssl\e_os2.h"
对于每个对目录存在不正确的无此类目录"错误,将括号更改为括号.
Change brackets to parentheses for every "No such Directory" error that is false to directory existence.
这篇关于致命错误:openssl/e_os2.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!