Problem in compiling C code generated by osmocom asn1c

萝らか妹 提交于 2019-12-13 17:03:53

问题


I have installed the osmocom asn1c compiler, the aper-prefix branch, to obtain an implementation of the TCAP protocol. I have used the respective script to compile the ".asn" files. The C files are generated successfully, but when compiling the obtained C code, an error is raised, which is related to this line of code:

#include <EXTERNAL.h>

In fact, the file EXTERNAL.h is missing (seemingly, the EXTERNAL type is not supported by this compiler). Is anyone aware of this problem and a possible solution?


回答1:


You have several options:

  1. Use a newer version of asn1c from this PR (still not merged)

  2. Copy the EXTERNAL.h from the osmocom repository

  3. Rename EXTERNAL to EXTERNALt in all asn files and add the following in the asn files that has EXTERNALt.

    --
    -- From "ITU-T Recommendation X.208", "34 The external type"
    --
    EXTERNALt ::= [UNIVERSAL 8] IMPLICIT SEQUENCE
    {direct-reference OBJECT IDENTIFIER OPTIONAL,
        indirect-reference INTEGER OPTIONAL,
        data-value-descriptor ObjectDescriptor OPTIONAL,
        encoding CHOICE
        {single-ASN1-type [0] ANY,
            octet-aligned [1] IMPLICIT OCTET STRING,
            arbitrary [2] IMPLICIT BIT STRING}}
    

    Or add it in a separate asn file and import where needed.



来源:https://stackoverflow.com/questions/53632962/problem-in-compiling-c-code-generated-by-osmocom-asn1c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!