asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Problem compiling: contains no objects

Open JSKim-Ranix opened this issue 1 year ago • 4 comments

There is a "v2x.asn" file like below.

===================================================================================

V2X DEFINITIONS AUTOMATIC TAGS::= BEGIN

CommTxPDU ::= SEQUENCE { index INTEGER (1..2147483647), payload OCTET STRING }

CommRxPDU ::= SEQUENCE { psid INTEGER (0..270549119), payload OCTET STRING }

V2X-MESSAGE ::= CLASS { &id OBJECT IDENTIFIER, &MessageBody }

Message V2X-MESSAGE ::= { {&id {1 0 15784 1 0 1}, &MessageBody SEQUENCE OF CommTxPDU} | {&id {1 0 15784 1 0 2}, &MessageBody SEQUENCE OF CommRxPDU} }

EndApplicationMessage ::= SEQUENCE { endApplication-Message-id V2X-MESSAGE.&id ({Message}), endApplication-Message-msg V2X-MESSAGE.&MessageBody ({Message}{@endApplication-Message-id}) } END

===================================================================================

When I run compile, the following error occurs.

===================================================================================

./asn1c -S ./share/asn1c -D ./src -fcompound-names -fincludes-quoted -fline-refs -fwide-types -gen-autotools -pdu=EndApplicationMessage v2x.asn

FATAL: Information Object Set Message contains no objects at line 18 FATAL: Cannot compile "EndApplicationMessage" (20:1) at line 25 FATAL: Cannot compile "EndApplicationMessage" (20:1) at line 25

===================================================================================

The cause of the error is adding "({Message})" and "({Message}{@endApplication-Message-id})". However, I am unable to delete the part or request modification. First, it has been determined based on specification(standard) and is already being used by other companies. Another reason is that the syntex check shows no problems, and compilation proceeds well with other compilers (Obj-system). And, we've already done so much with the asn1c compiler. Thank you to everyone who helps. The share folder is attached. share.zip

v2x.asn.zip

JSKim-Ranix avatar Jan 17 '24 10:01 JSKim-Ranix

The cause of error is (as I understand it) inability of the free compilers like asn1c to process the new ASN.1 constructs added to the language in mid-2000.

I personally consider those additions an absolute abomination, but some standards are misguided enough to utilize them. As a result, you may be forced to use those commercial compilers - I don't have either time or skills to enhance asn1c to support them.

mouse07410 avatar Jan 17 '24 12:01 mouse07410

Out of curiosity @JSKim-Ranix, which standard is this?

v0-e avatar Jan 17 '24 12:01 v0-e

Out of curiosity @JSKim-Ranix, which standard is this?

It is a modification of the ISO 14827(DATEX-ASN) standard to suit C2X (Center to Everything) for C-ITS(Cooperative-Intelligent Transport Systems).

The cause of error is (as I understand it) inability of the free compilers like asn1c to process the new ASN.1 constructs added to the language in mid-2000.

I personally consider those additions an absolute abomination, but some standards are misguided enough to utilize them. As a result, you may be forced to use those commercial compilers - I don't have either time or skills to enhance asn1c to support them.

I have a question. I tested v2x.asn with the master branch, and compile was completed. Couldn't we find a way to solve the problem by compare the vlm_master branch and master branch? After developing using asn1c for 3 years, it is a very difficult decision to change to a commercial compilers. The master branch solves this problem, but has many other problems that make it difficult to use. We really want to use vlm_master branch.

JSKim-Ranix avatar Jan 18 '24 01:01 JSKim-Ranix

@JSKim-Ranix, the master branch may allow you to compile, but I'm doubtful that the output associated with EndApplicationMessage is useful. If you don't mind, please try my branch associated with PR #172, to see if it compiles successfully. I'm concerned about the &id's type being a OBJECT IDENTIFIER and I'm not sure if it is being compiled correctly. But that would probably be a separate issue.

v0-e avatar Jan 22 '24 12:01 v0-e

~~I assume this one has been fixed, but~~ in any case it is beyond my competence.

mouse07410 avatar Sep 17 '25 11:09 mouse07410

@copilot prepare PR

mouse07410 avatar Sep 22 '25 11:09 mouse07410