我需要 asn1 BER 编码器/解码器,并发现它是“asn1c”编译器的一部分(这是链接http://lionet.info/asn1c/blog/)。
我使用“configure, make, make install”程序编译整个东西没有问题,但似乎不可能单独编译。
我正在尝试将此包的 BER 编码器/解码器功能编译到 NetBeans 中的静态库中。但是,我遇到了一些“包含”废话的大问题。这是一个例子......
在 asn1parser.h 文件中有一个名为“asn1c_integer_t”的新类型的 typedef
//some preprocessor statements removed to keep this post short...
typedef intmax_t asn1c_integer_t;
#include "asn1p_list.h"
#include "asn1p_oid.h" /* Object identifiers (OIDs) */
#include "asn1p_ref.h" /* References to custom types */
etc...
但是,前一个文件中包含的一些文件(例如 asn1p_oid.h)正在使用前一个文件中定义的新数据类型。
#ifndef ASN1_PARSER_OID_H
#define ASN1_PARSER_OID_H
typedef struct asn1p_oid_arc_s {
asn1c_integer_t number; /* -1 if not yet defined */
char *name; /* 0 if not defined */
} asn1p_oid_arc_t;
etc...
这对我来说毫无意义,而且我不断收到以下错误:
asn1parser.h:32: 错误:在 'asn1c_integer_t' 之前需要 '='、','、';'、'asm' 或 '<strong>attribute'</p>
谁能帮我解决这个问题?