The reason is that you used: abst@ype struct_foo
Instead, you need the following line: abst@ype struct_foo = $extype"struct foo" The compiler needs to know the size of struct_foo during compilation. On Monday, August 22, 2016 at 6:44:08 AM UTC-4, Kiwamu Okabe wrote: > > Also I have another question. > > I split template_struct/main.dats file into following three files: > > > https://github.com/jats-ug/practice-ats/blob/ac1e4fd22035e643d5211891c16564dda6ff5fcc/template_struct/gen.sats > > > https://github.com/jats-ug/practice-ats/blob/ac1e4fd22035e643d5211891c16564dda6ff5fcc/template_struct/gen_tmpl.dats > > > https://github.com/jats-ug/practice-ats/blob/ac1e4fd22035e643d5211891c16564dda6ff5fcc/template_struct/main.dats > > > But I have following error on gcc side... > > ``` > $ pwd > /home/kiwamu/src/practice-ats/template_struct > $ make > /home/kiwamu/src/ATS-Postiats/bin/patscc -o a.out main.dats > -DATS_MEMALLOC_LIBC > In file included from main_dats.c:15:0: > main_dats.c: In function 'mainats_void_0': > main_dats.c:1380:21: error: unknown type name 'struct_foo' > ATStmpdec(tmpref48, struct_foo) ; > ^ > /home/kiwamu/src/ATS-Postiats/ccomp/runtime/pats_ccomp_instrset.h:199:29: > note: in definition of macro 'ATStmpdec' > #define ATStmpdec(tmp, hit) hit tmp > ^~~ > main_dats.c:1381:21: error: unknown type name 'struct_bar' > ATStmpdec(tmpref49, struct_bar) ; > ^ > /home/kiwamu/src/ATS-Postiats/ccomp/runtime/pats_ccomp_instrset.h:199:29: > note: in definition of macro 'ATStmpdec' > #define ATStmpdec(tmp, hit) hit tmp > ^~~ > Makefile:7: recipe for target 'a.out' failed > make: *** [a.out] Error 1 > ``` > > ... Why??? > > Best regards, > -- > Kiwamu Okabe > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/858f8bad-af57-4612-9e51-3be28529b079%40googlegroups.com.
