Pro-C/C++编译找不到 stddef.h 文件的解决办法

以编译一个 sample 为例,出现找不到 “stddef.h” 文件的错误,如下:

$ proc sample.pc

Pro*C/C++: Release 11.2.0.1.0 - Production on Wed Dec 26 00:40:15 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: /usr/local/oracle/product/11.2.0/dbhome_1/precomp/admin/pcscfg.cfg

Error at line 33, column 10 in file /usr/include/stdlib.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 147, column 10 in file /usr/include/sys/types.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 25, column 10 in file /usr/include/alloca.h
#include <stddef.h>
.........1

...........

解决办法:
1. 先确定 stddef.h 在gcc的哪个目录下
find /usr -name stddef.h
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include/stddef.h

2. 在 $ORACLE_HOME/precomp/admin/pcscfg.cfg 文件中加入这个目录
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include/


然后再编译:
$ proc sample.pc

生成对应的 sample.c 文件,问题解决。



mktemp -u XXXXXX 932979 test_cpp_condition stddef.h __riscv_zbb test_cpp BEGIN /tmp/ffconf.c1932982/test.c 1 #include <stddef.h> 2 #if !(__riscv_zbb) 3 #error "unsatisfied condition: __riscv_zbb" 4 #endif END /tmp/ffconf.c1932982/test.c riscv64-tizen-linux-gnu-gcc -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -Wformat -fmessage-length=0 -Wno-implicit-fallthrough -Wl,-z,relro,--as-needed -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -Wl,-O1 -Wl,--hash-style=gnu -g -Wall -g -fPIC -DTIZEN_FEATURE_FFMPEG -DDBG_GSTFFMPEG_ALONE -DENABLE_SW_TBM_VXIMAGESINK -DTIZEN_PRODUCT_TV -DDRM_MAPI_AARCH_64 -fno-lto -fPIC -march=rv64gcv_zbb -I/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/fdk-aac/include -I/usr/include/libpng16 -Wl,-z,relro -E -o /tmp/ffconf.c1932982/test.o /tmp/ffconf.c1932982/test.c test_ld cc test_cc BEGIN /tmp/ffconf.c1932982/test.c 1 int main(void){ return 0; } END /tmp/ffconf.c1932982/test.c riscv64-tizen-linux-gnu-gcc -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -Wformat -fmessage-length=0 -Wno-implicit-fallthrough -Wl,-z,relro,--as-needed -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -Wl,-O1 -Wl,--hash-style=gnu -g -Wall -g -fPIC -DTIZEN_FEATURE_FFMPEG -DDBG_GSTFFMPEG_ALONE -DENABLE_SW_TBM_VXIMAGESINK -DTIZEN_PRODUCT_TV -DDRM_MAPI_AARCH_64 -fno-lto -fPIC -march=rv64gcv_zbb -I/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/fdk-aac/include -I/usr/include/libpng16 -Wl,-z,relro -c -o /tmp/ffconf.c1932982/test.o /tmp/ffconf.c1932982/test.c riscv64-tizen-linux-gnu-gcc -ldl -L/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/fdk-aac/lib -L/usr/lib -Wl,-z,relro,-z,now -o /tmp/ffconf.c1932982/test /tmp/ffconf.c1932982/test.o -ldl -lpng16 -lfdk-aac /usr/lib64/gcc/riscv64-tizen-linux-gnu/13.1.0/../../../../riscv64-tizen-linux
03-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值