Closed zqb-all closed 1 year ago
The cause of such issue is the stdio.h in your OS environment does not have stddef.h in the same directory. Follow the following steps to resolve your issue:
After add dir for stddef.h
, stdarg.h
, tr1/cstdio
, error is error: use of undeclared identifier 'printf'
[root@10bd68b2e728 open64_20230606]# cat /toolchain/helloworld/hello.c
#include <stdio.h>
int main()
{
printf("hello\n");
}
[root@10bd68b2e728 open64_20230606]# bin/openCC -clang -emit-llvm -fno-exceptions -O3 -OPT:malloc_alg=off -PHASE:c=off -c -sw -kp -I/usr/include -I/usr/include/linux -I/usr/include/c++/4.8.2/tr1 -I/usr/include/c++/4.8.2/ /toolchain/helloworld/hello.c
openCC WARNING: unknown flag: -sw
openCC WARNING: unknown flag: -kp
openCC WARNING: unsupported vendor_id in /proc/cpuinfo, defaulting to basic 64-bit x86.
/toolchain/helloworld/hello.c:5:2: error: use of undeclared identifier 'printf'
printf("hello\n");
^
1 error generated.
check this solution https://github.com/open64-compiler/open64/issues/22#issuecomment-1660727799