vc2012\vc\include\stdlib.h(360): error C2381: “exit”: 重定义;__declspec(noreturn) 不同

本文详细探讨了在使用OpenGL时遇到的C2381错误问题,包括更新后的编译问题、解决方法以及对于新手开发者的重要启示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

opengl中关于C2381的问题网上已经有很多的解决方法了。
其实我是个新手,之前用的是2012的uodate3.在提示我更新的时候我更新了、update4,在这之后我以前写的程序在运行的时候都出先了

c2012\vc\include\stdlib.h(360): error C2381: “exit”: 重定义;__declspec(noreturn) 不同
 d:\vc2012\vc\include\glut.h(146) : 参见“exit”的声明

这个问题。我按照网上的各种方法都尝试了,还是不行。网上给出的很多一般方法都是把#include<stdlib.h>放在#include<glut.h>前面,这个问题就解决了。而我就纳闷了,作为新手,之前写程序的时候都要用到什么库,就写什么库,一般都不会刻意的写#include<stdlib.h>,也是可以正常运行调试的,可现在我没写,那网上的方法我就不能用了啊。于是继续搜索相关问题,看到国外网站有写这个,说是讲stdlib.h中的“exit”函数复制到glut.h中去,这个问题就解决了(不过我没有尝试)。最后在我原来写的程序前面加上了#include<stdlib.h>之后编译通过了。
我不知道这是为什么,之前同样在写的时候没有加这个依然能够顺利编译通过,可是在更新了update4之后就不行了,到目前还是不懂,会继续关注更近这个问题,希望知道的大牛们能帮小弟解除这个疑惑
In file included from cryptlib.c:117:0: cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory # include <stdlib.h> ^ compilation terminated. mem.c:59:19: fatal error: stdio.h: No such file or directory #include <stdio.h> ^ compilation terminated. mem_clr.c:60:20: fatal error: string.h: No such file or directory #include <string.h> ^ compilation terminated. mem_dbg.c:112:19: fatal error: stdio.h: No such file or directory #include <stdio.h> ^ compilation terminated. In file included from cversion.c:59:0: cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory # include <stdlib.h> ^ compilation terminated. In file included from ex_data.c:141:0: cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory # include <stdlib.h> ^ compilation terminated. cpt_err.c:62:19: fatal error: stdio.h: No such file or directory #include <stdio.h> ^ compilation terminated. In file included from uid.c:56:0: ../include/openssl/crypto.h:120:21: fatal error: stdlib.h: No such file or directory # include <stdlib.h> ^ compilation terminated. o_time.c:65:20: fatal error: string.h: No such file or directory #include <string.h> ^ compilation terminated. o_str.c:60:19: fatal error: ctype.h: No such file or directory #include <ctype.h> ^ compilation terminated. o_dir.c:60:19: fatal error: errno.h: No such file or directory #include <errno.h> ^ compilation terminated. In file included from o_fips.c:59:0: cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory # include <stdlib.h> ^ compilation terminated. In file included from o_init.c:56:0: ../e_os.h:468:28: fatal error: unistd.h: No such file or directory # include OPENSSL_UNISTD ^ compilation terminated. getenv.c:14:20: fatal error: stdlib.h: No such file or directory #include <stdlib.h> ^ compilation terminated. Makefile:138: recipe for target 'local_depend' failed make[1]: *** [local_depend] Error 1 make[1]: Leaving directory '/home/holand/work/openssl-OpenSSL_1_0_2u/crypto' Makefile:483: recipe for target 'depend' failed make: *** [depend] Error 1
最新发布
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值