致命错误:OpenSSL的/ e_os2.h:没有这样的文件或目录
问题描述:
下载SMTP客户端从链接SSL/TLS库:https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS][1]。致命错误:OpenSSL的/ e_os2.h:没有这样的文件或目录
包括在我的NetBeans项目“头文件”文件夹,将获取的main.cpp文件摆脱错误的CSmtp.h文件。
我得到的编译错误“致命错误:OpenSSL的\ ssl.h:没有这样的文件或目录”添加“OpenSSL的”文件夹到NetBeans项目目录的根目录之前。
现在加入“OpenSSL的”文件夹后,我收到错误:
fatal error: openssl/e_os2.h: No such file or directory
错误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”因为ssl.h在OpenSSL的文件夹“e_os2.h”一起发现的。您对这个编译器错误的专家建议将不胜感激。
答
首先必须确保openssl文件夹(在openssl-0.9.8l \ inc32中找到所有.h文件的文件夹)位于CodeProject实现(CSmtp_v2_4_ssl.zip)的“main.cpp”范围内。接下来编辑“ssl.h”文件;现在找到的声明
#include <openssl\e_os2.h>
变化
#include "openssl\e_os2.h"
变化括号括号每一个“没有这样的目录”的错误那是假的,以目录的存在。