从链接:[https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS][1]下载带有SSL/TLS库的SMTP客户端。
将CSmtp.h文件包含在我的Netbeans项目"Header Files“文件夹中,该文件夹消除了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“,因为ssl.h与"e_os2.h”一起出现在openssl文件夹中。您对此编译器错误的专家建议将不胜感激。
发布于 2017-10-12 00:19:16
首先必须确保openssl文件夹(包含所有.h文件的文件夹)。OpenSSL-0.9.8l\inc32中的内容位于来自CodeProject实现(CSmtp_v2_4_ssl.zip)的“CSmtp_v2_4_ssl.zip”范围内。接下来编辑"ssl.h“文件;现在找到声明
#include <openssl\e_os2.h>更改为
#include "openssl\e_os2.h"将括号更改为括号,以避免每个“没有这样的目录”错误,该错误对于目录的存在是错误的。
https://stackoverflow.com/questions/43553483
复制相似问题