- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我已经安装了最新版本的 OpenSSL 。我只是尝试编译并运行程序 OpenSSL_aes .
使用 gcc -Wall openssl_aes.c -lcrypto 编译时出现以下错误。我尽力解决了这个问题,但无法解决这个编译错误。
openssl_aes.c: In function ‘aes_encrypt’:
openssl_aes.c:51:22: error: ‘AES_BLOCK_SIZE’ undeclared (first use in this function)
int c_len = *len + AES_BLOCK_SIZE, f_len = 0;
^
openssl_aes.c:51:22: note: each undeclared identifier is reported only once for each function it appears in
openssl_aes.c: In function ‘aes_decrypt’:
openssl_aes.c:75:45: error: ‘AES_BLOCK_SIZE’ undeclared (first use in this function)
unsigned char *plaintext = malloc(p_len + AES_BLOCK_SIZE);
^
编辑:
当我添加 #include<openssl/aes.h>
时根据@martin,编译问题已解决。
至此,gcc -Wall openssl_aes.c -lcrypto 编译成功。
但是,当我尝试运行该程序(运行我使用 - ./a.out )时,出现以下错误段错误(核心已转储)
谁能帮我解决这个问题并运行我的程序?我只想使用 OpenSSL 执行简单的 aes 加密/解密。我在 Fedora 19 下使用 GCC。
提前致谢。
最佳答案
您可能没有包含 openssl/aes.h
,因为 AES_BLOCK_SIZE
在其中定义为:#define AES_BLOCK_SIZE 16
。因此,请确保您拥有:
#include <openssl/aes.h>
在你的文件中。
关于c - 错误 : ‘AES_BLOCK_SIZE’ undeclared. 无法在 Linux 中使用 C 编译 OpenSSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21512424/
关闭。这个问题需要debugging details .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 5年前关闭。 Improve this question 我在
我的代码即将完成,但它给了我这个错误:“curtemp:未声明的标识符”。和“prevtemp:未声明的标识符”和“缺少”;”在类型'之前(最后一个错误是在“float curtemp = curre
我有两个存储过程,第一个参数带有静态,并且运行良好但是当我使用动态参数时,它给了我一个错误未声明的变量:limitvar 1/程序 `DELIMITER $$ DROP PROCEDURE IF EX
我收到这个奇怪的错误: app_server.c: In function ‘wasFeedRead’: app_server.c:269:14: error: ‘tmp’ undeclared (f
我的编译器和我无法就声明达成一致.. game *copyGame(game *game) { game *copy = newGame(game->size); copy->size = g
我收到错误“currentUpdateMethod”未声明(首次在此函数中使用)。 this 引用的变量 currentUpdateMethod 是在头文件中声明的 SEL 类型的实例变量。因为构建到
我正在使用 linux c 中的克隆功能。 但是,当我尝试编译我的代码时遇到错误 CLONE_VM undeclared (first use in this function)。 我去谷歌寻找解决方
为什么在编译 GLSL 几何着色器时会出现此错误? ERROR: 0:15: 'gl_VerticesIn' : undeclared identifier 这是着色器: // makes wiref
当我尝试编译我的程序时,我在下面收到此错误,但我已经包含了包含“LittleMonkey”类声明的头文件。 1>------ Build started: Project: Estrellas, Co
在以python-2.7.6作为引用编译VC++ 2008项目时,出现以下错误 Python27/symtable.h(55): error C2065: 'mod_ty': Undeclared I
我试图在 Delphi XE2 中使用 randomrange 函数,但由于某种原因,它在尝试运行它时不断给我一个未声明的标识符错误,这是我的代码。 var Form3: TForm3; nu
来自 the web我知道 C 包含 NUL 关键字。 编译时出现错误 NUL undeclared first use in this function' 我的代码片段: for (;;) {
我正在使用 Eclipse BPEL Designer 和 Apache ODE。然后我尝试在 catalina.out 中部署我的流程,但收到错误 org.apache.ode.bpel.iapi.
我有以下代码: for(int iY=0;iY<(Height-YRemainder);iY=iY+16); { for(int iX=0;iX<
我尝试在程序中使用结构,但收到一堆错误消息,指出 time1、time2 和 hourDif 是未声明的标识符。我以为我按照你应该的方式声明了这些结构,所以我对问题是什么感到困惑。 代码如下: #in
我正在使用信号量创建生产者和消费者文件以进行同步。我创建了一个定义 sem_t 变量的结构。 sem_t 变量之一是互斥体。 Mutex 代表互斥。但是,当我编译代码时出现错误,提示“互斥体”未声明。
我遇到了这个问题: LOWORD 未声明 使用这段代码: case WM_COMMAND: { if (lParam==0) {
抱歉我的英语不好。 我的代码 #include int main(void) { CONDITION_VARIABLE cond; return 0; } 编译时出
我正在尝试为对象设置安全权限。这是代码: PROCESS_INFORMATION pi = {0}; STARTUPINFO si = {0}; si.cb = sizeof(
关于导致此编译时错误的原因的任何想法? 基本设置: main.cpp #include #include "GroupTheorizer.h" int main() { // ...
我是一名优秀的程序员,十分优秀!