github_36625048
JhonHelp
采纳率0%
2017-01-20 01:37

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条回答

  • oyljerry oyljerry 4年前

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

    点赞 评论 复制链接分享

相关推荐