用arm-linux-g++,编译C代码

遇到的问题:

issue`1:

    uses anonymous type osaes.h:38: error: 'typedef struct<anonymous> aesStruct_t' does not refer to the unqualified type, so it is not used for linkage.

solution:

1.定义头文件的时候加上

        #ifdef        __cplusplus//支持C,C++编译器
        extern "C"
        {
        #endif

        #define "xxx.h"

        #ifdef        __cplusplus
        }
        #endif

2.去掉C代码定义结构体的attribute。


issue`2:

    warning: NULL used in arithmetic.

solution:

    注意(void *)0和0是不等价的,修改一下就好。



posted @ 2015-01-26 16:27  oMengLvRong  阅读(871)  评论(0编辑  收藏  举报