2017-09-07 6 views
0

clang을 사용하여 코드를 컴파일하는 동안 매우 이상한 오류가 발생했습니다.pthreadtypes.h에 대한 이상한 컴파일 오류 : 'section'속성

여기 내 명령

$clang -c -emit-llvm -I/OP-TEE/op-tee-os/optee_os/lib/libutee/include/ -I/OP-TEE/op-tee-os/optee_os/lib/libutils/ext/include/ test_function_call_ta.c 

이며, 여기에 오류가 :

In file included from /usr/include/stdlib.h:314: 
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:270: 
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:200:5: error: 'section' attribute only applies to functions, methods, 
     properties, and global variables 
    } __data; 
    ^
/opensource_projects/OP-TEE/op-tee-os/optee_os/lib/libutils/ext/include/compiler.h:51:17: note: expanded 
     from macro '__data' 
#define __data   __section(".data") 
         ^
/opensource_projects/OP-TEE/op-tee-os/optee_os/lib/libutils/ext/include/compiler.h:50:37: note: expanded 
     from macro '__section' 
#define __section(x) __attribute__((section(x))) 

이 오류가 일어나는 이유는 내가 어떤 부분은 소스 코드에 속성을 사용하지 않았기 때문에 나는 궁금했다.

미리 감사드립니다.

답변

0

마지막으로이 문제가 해결되었습니다. 그 이유는 "-I"로 잘못된 헤더 파일을 가져 오기 때문입니다. 올바른 폴더는 다른 폴더에 있어야합니다 ...