首页 > 解决方案 > C++ - 如何在 CodeBlocks 中链接 OpenSSL 库?

问题描述

我正在尝试在 CodeBlocks 中链接 OpenSSL。我已将文件移至“include”目录,并且已将“configuration.h.in”的名称更改为“configuration.h”,但现在我收到此错误:

||=== Build: Debug in lokk (compiler: Cywin) ===|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|27|error: expected identifier or '(' before '{' token|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|27|error: stray '@' in program|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|28|error: stray '@' in program|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|34|error: stray '@' in program|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|38|error: stray '@' in program|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|39|error: stray '@' in program|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|49|error: expected identifier or '(' before '{' token|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|55|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|57|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|58|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\configuration.h|59|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|104|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|112|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|116|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|120|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|139|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|149|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|159|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|169|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|179|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|189|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\macros.h|199|error: token "{" is not valid in preprocessor expressions|
C:\Program Files (x86)\DevCpp\MinGW64\x86_64-w64-mingw32\include\stddef.h|24|error: expected ',' or ';' before 'extern'|
C:\Program Files (x86)\DevCpp\MinGW64\include\openssl\types.h|20|fatal error: openssl/safestack.h: No such file or directory|
||=== Build failed: 24 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

如果有人可以帮助我,非常感谢。

标签: c++openssllinker

解决方案


推荐阅读