-1

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.

user567
  • 3,712
  • 9
  • 47
  • 80
  • You're going to need to give more info, such as a minimal example of what you're compiling, or the intermediate C code. – Dave May 10 '14 at 14:22

1 Answers1

1

Compiler errors look cryptic, but they’re designed to be read by humans. Usually the first error you see is the best indication of the problem (assuming there is only one).

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

So there is no header ber_tlv_length.h in the compiler’s search path. It looks like this is one of the headers that should be included with the lionet.info code. So figure out where these headers are, and either move them to a location you know the compiler is already searching for headers, or tell the compiler to look where they are (-I/path/to/headers/).

musicinmybrain
  • 621
  • 4
  • 8