Compiling asn1c output on Windows
I've generated c files from an asn1 is it possible to take those files and compile them on a windows machine.
Hi @ronMilne,
Yes, it should be possible.
apologies, I meant i generated the files in Unbuntu then copied them to windows.
The answer is still yes.
running gcc on windows I get the following compilation error In file included from ./asn_application.h:11:0, from ./asn_internal.h:12, from INTEGER.c:6: INTEGER.c: In function 'INTEGER__dump': ./asn_system.h:137:21: error: expected ')' before 'PRIdMAX' #define ASN_PRIdMAX PRIdMAX ^ INTEGER.c:152:10: note: in expansion of macro 'ASN_PRIdMAX' "%" ASN_PRIdMAX " (%s)", value, el->enum_name); ^~~~~~~~~~~ ./asn_system.h:136:21: error: expected ':' before 'PRIuMAX' #define ASN_PRIuMAX PRIuMAX ^ INTEGER.c:164:54: note: in expansion of macro 'ASN_PRIuMAX' ? "%" ASN_PRIuMAX
Hi @ronMilne,
Try including inttypes.h in asn_system.h.
See also http://www.cplusplus.com/reference/cinttypes/ and try to compile the example.
In case you are using mingw try defining __USE_MINGW_ANSI_STDIO.
See:
https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/
http://lists.gnu.org/archive/html/bug-gnulib/2015-05/msg00011.html
I'm having a similar error while "Compiling asn1c output on Windows". I get the error " error C2016: C requires that a struct or union has at least one member" because several union are empty. Is there any way to avoid this error without having to add a member in those unions?
I'm having a similar error while "Compiling asn1c output on Windows". I get the error " error C2016: C requires that a struct or union has at least one member" because several union are empty. Is there any way to avoid this error without having to add a member in those unions?
@delinage Did you ever get past this issue? I am running in to the same now.
Are we STILL having this issue?