vc6 mfc工程添加#include <openssl/ssl.h> 就报语法错误,意外符号错误

win7-en-32 vc6 创建的mfc工程,openssl路径已经设置好,加入

 #include <openssl/ssl.h> 
#include <openssl/err.h> 
#include<ws2tcpip.h>
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
#pragma comment(lib, "Ws2_32.lib")

报错如下
Compiling...
Dialog.cpp
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ')' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ';' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : fatal error C1004: unexpected end of file found
Generating Code...
Compiling...
IHope_Client.cpp
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ')' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ';' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : fatal error C1004: unexpected end of file found
Generating Code...
Compiling...
IHope_ClientDlg.cpp
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ')' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ';' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : fatal error C1004: unexpected end of file found
Generating Code...
Compiling...
RemoteDestTop.cpp
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(327) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\bn.h(341) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2059: syntax error : 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(859) : error C2238: unexpected token(s) preceding ';'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ')' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : error C2143: syntax error : missing ';' before 'constant'
c:\openssl-1.0.2j\include\openssl\ssl.h(2318) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.

IHope_Client.exe - 36 error(s), 0 warning(s)


1个回答

VC6太老了,openssl的库文件可能不支持vc6了,它应该都是vs2012等以上的编译器支持

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐