armink / struct2json

A fast convert library between the JSON and C structure. Implement structure serialization and deserialization for C. | C 结构体与 JSON 快速互转库,快速实现 C 结构体的序列化及反序列化
MIT License
680 stars 293 forks source link

error: redeclaration of ‘json_temp’ with no linkage cJSON *json_temp; #23

Closed THEheng closed 3 years ago

THEheng commented 3 years ago

./src/struct2json-master/struct2json/inc/s2jdef.h:171:12: error: redeclaration of ‘json_temp’ with no linkage cJSON json_temp; \ ^ ./src/struct2json-master/struct2json/inc/s2j.h:66:5: note: in expansion of macro ‘S2J_CREATE_STRUCT_OBJECT’ S2J_CREATE_STRUCT_OBJECT(struct_obj, type) ^ src/service.c:28:5: note: in expansion of macro ‘s2j_create_struct_obj’ s2j_create_struct_obj(data, QT_DATA); ^ ./src/struct2json-master/struct2json/inc/s2jdef.h:171:12: note: previous declaration of ‘json_temp’ was here cJSON json_temp; \ ^ ./src/struct2json-master/struct2json/inc/s2j.h:66:5: note: in expansion of macro ‘S2J_CREATE_STRUCT_OBJECT’ S2J_CREATE_STRUCT_OBJECT(struct_obj, type) ^ src/service.c:18:5: note: in expansion of macro ‘s2j_create_struct_obj’ s2j_create_struct_obj(base, BASE);

我没动过这代码啊。 是BUG吗?还是我没用对?