I generated some C classes from an ASN.1 description with this compiler lionet.info/asn1c . When I trie to compile the code with GCC I have errors, this is a peice of them
in file included from asn_application.h:45, from client.c:10: constr_TYPE.h:15:28: error: ber_tlv_length.h: No such file or directory constr_TYPE.h:16:25: error: ber_tlv_tag.h: No such file or directory In file included from asn_application.h:45, from client.c:10: constr_TYPE.h:35: error: expected specifier-qualifier-list before ‘ber_tlv_len_t’ constr_TYPE.h:38:60: error: ber_decoder.h: No such file or directory constr_TYPE.h:39:68: error: der_encoder.h: No such file or directory constr_TYPE.h:40:58: error: xer_decoder.h: No such file or directory constr_TYPE.h:41:60: error: xer_encoder.h: No such file or directory constr_TYPE.h:42:61: error: per_decoder.h: No such file or directory constr_TYPE.h:43:61: error: per_encoder.h: No such file or directory constr_TYPE.h:44:59: error: constraints.h: No such file or directory constr_TYPE.h:77: error: expected declaration specifiers or ‘...’ before ‘ber_tlv_tag_t’ constr_TYPE.h:77: error: ‘ber_tlv_tag_t’ declared as function returning a function constr_TYPE.h:77: warning: parameter names (without types) in function declaration constr_TYPE.h:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘asn_TYPE_outmost_tag’ constr_TYPE.h:95: error: expected specifier-qualifier-list before ‘asn_constr_check_f’ constr_TYPE.h:144: error: field ‘tag’ declared as a function constr_TYPE.h:147: error: expected specifier-qualifier-list before ‘asn_constr_check_f’ constr_TYPE.h:157: error: field ‘el_tag’ declared as a function In file included from client.c:11: asn_codecs_prim.h:8:29: error: asn_application.h: No such file or directory In file included from client.c:11: asn_codecs_prim.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘ber_decode_primitive’ asn_codecs_prim.h:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘der_encode_primitive’ In file included from client.c:15: ber_decoder.h:56: error: expected declaration specifiers or ‘...’ before ‘ber_tlv_len_t’
In eclipe a got
Invoking: GCC C Compiler gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/BIT_STRING.d" -MT"src/BIT_STRING.d" -o "src/BIT_STRING.o" "../src/BIT_STRING.c" ../src/BIT_STRING.c:5:26: warning: asn_internal.h: No such file or directory ../src/BIT_STRING.c:6:24: warning: BIT_STRING.h: No such file or directory ../src/BIT_STRING.c:12: error: expected '=', ',', ';', 'asm' or 'attribute' before 'asn_DEF_BIT_STRING_tags' ../src/BIT_STRING.c:15: error: expected '=', ',', ';', 'asm' or 'attribute' before 'asn_DEF_BIT_STRING_specs' ../src/BIT_STRING.c:20: error: expected '=', ',', ';', 'asm' or 'attribute' before 'asn_DEF_BIT_STRING' ../src/BIT_STRING.c:48: error: expected ')' before '' token ../src/BIT_STRING.c:76: error: expected '=', ',', ';', 'asm' or 'attribute' before 'BIT_STRING_encode_xer' ../src/BIT_STRING.c:141: error: expected ')' before '' token make: * [src/BIT_STRING.o] Error 1
In eclipce I just added the generated classes in the src folder and added the headers.