从链接下载了带有 SSL/TLS 库的 SMTP 客户端:[https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS][1] https://www.codeproject.com/Articles/98355/SMTP-Client-with-SSL-TLS%5D%5B1%5D.
将 CSmtp.h 文件包含在我的 Netbeans 项目“头文件”文件夹中,这消除了 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 文件夹中找到。我们将非常感谢您对此编译器错误的专家建议。
首先必须确保 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"
将每个“没有这样的目录”错误的方括号更改为圆括号,该错误表明目录存在。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)