求指导,C程序运行openssl里面的函数没反应
刚安装完openssl-1.1.1f,想跑一个算hash的函数,代码如下:
#include<stdio.h>
#include<stdint.h>
#include <openssl/sha.h>
int main(int argc,char **argv)
{
printf("hello world\n");
unsigned char hash[SHA_DIGEST_LENGTH];
unsigned char content[4096] = {'\x41'};
unsigned int len = 4096;
unsigned char *res = SHA1(content,len,hash);
printf("digest = %s",hash);
return 0;
}
在windows的cmd下用gcc编译,命令gcc -o test test.c -llibssl -llibcrypto
结果运行exe程序只打印了hello world,过了几秒exe窗口自动关闭了,试了SHA256的函数也是一样的情况,请问是什么问题?