> > $ pkg-config sdl2 --cflags > -I/usr/include/SDL2 -D_REENTRANT >
As a side-note, I passed the $PATSCONTRIB -I flag to the make command and it built test00 and test01, but test02 failed and test01 will not run, instead throwing an error on the first use of assertloc. /usr/local/lib/ats2-postiats-0.3.13/contrib/SDL2/test/test01.dats: > 311(line=25, offs=18) -- 331(line=25, offs=38) > test02 throws the same error as I had originally due to having different cflags, so I think I am going to have to edit the makefile to get it to recognize the added -I flag. On Tue, Apr 2, 2019 at 4:57 AM Artyom Shalkhakov < [email protected]> wrote: > Matt, > > Indeed it's quite puzzling to me as well. > > вт, 2 апр. 2019 г. в 11:33, Matt Chelen <[email protected]>: > >> Manually including the contrib folder with a -I flag seems to have worked >> (other than the SDL_GetVersion function causing an undefined reference >> error), but I'm still confused as to why it didn't just work. The >> documentation basically states that the way I had it set up is a valid way >> to set up the contrib folder, whereas having to manually include the >> contrib folder says the opposite. >> >> > Could you tell me what the following command evaluates to in your terminal: > > $ pkg-config sdl2 --cflags > > I picked it up from here: > > > https://github.com/githwxi/ATS-Postiats-contrib/blob/master/contrib/SDL2/TEST/Makefile > > Notice that in this makefile, CFLAGS are added to the C compiler so that > it can find SDL2. Maybe the makefile should also add an -I<directory of > contrib/>. > > On Tue, Apr 2, 2019 at 4:23 AM Artyom Shalkhakov < >> [email protected]> wrote: >> >>> вт, 2 апр. 2019 г. в 11:19, Matt Chelen <[email protected]>: >>> >>>> I just realized now that the file referenced in the comment is the SATS >>>> file and that I had misread it, but it should hold that, if it can find the >>>> SATS file, which is simply in a different subdirectory of contrib/SDL2, it >>>> should be able to find the CATS file, unless I am mistaken about how this >>>> is supposed to be set up. >>>> >>>> >>> Well, the #includes in .cats files are resolved by the underlying C >>> compiler, hence I think the issue is somehow in the C compiler (maybe it >>> needs another -I flag or some such?) >>> >>> >>>> On Tue, Apr 2, 2019 at 4:13 AM Matt Chelen <[email protected]> >>>> wrote: >>>> >>>>> My contrib folder is in $PATSHOME/contrib. I've tried setting both the >>>>> $PATSCONTRIB environment variable to both $PATSHOME, which I think the >>>>> documentation said to do (it is entirely possible that I misunderstood the >>>>> phrasing), and $PATSHOME/contrib, both with the same result. >>>>> >>>>> The SDL2 folder is in the contrib folder. It's just cloned from the >>>>> GitHub repo and copied in there. The examples that I'm trying to build are >>>>> in $PATSHOME/contrib/SDL2/TEST and the actual bindings are in >>>>> $PATSHOME/contrib/SDL2/CATS/SDL.cats. >>>>> >>>>> Here's the relevant part of the generated C file, showing that it has >>>>> the correct path to the file in question in the comment. >>>>> >>>>> /* >>>>> /usr/local/lib/ats2-postiats-0.3.13/contrib/SDL2/SATS/SDL.sats: >>>>> 899(line=29, offs=1) -- 941(line=33, offs=3) >>>>> */ >>>>> >>>>> // >>>>> #include "SDL2/CATS/SDL.cats" >>>>> >>>>> What it looks like (to me) is that it's just not resolving properly. >>>>> None of the prelude ATS files that are included before that point are >>>>> throwing errors. Just that one. Manually changing the location to >>>>> "contrib/SDL2/CATS/SDL.cats" allows patscc to get past the error, but I >>>>> then run into similar errors with the files that it includes. I'm just not >>>>> sure why it's not resolving properly. Adding contrib to the beginning is >>>>> required to get it to resolve even if I set $PATSCONTRIB to >>>>> $PATSHOME/contrib. >>>>> >>>>> Do you think it might work properly if I move $PATSCONTRIB somewhere >>>>> else or is something else going on? >>>>> >>>>> On Tuesday, April 2, 2019 at 3:07:05 AM UTC-4, Artyom Shalkhakov wrote: >>>>>> >>>>>> Hi Matt, >>>>>> >>>>>> On Monday, April 1, 2019 at 6:53:00 PM UTC+3, Matt Chelen wrote: >>>>>>> >>>>>>> I'm trying to get ATS-Contrib set up and I'm concerned that I don't >>>>>>> currently have it configured correctly. As per the documentation, I put >>>>>>> the >>>>>>> "contrib" folder in $PATSHOME and set $PATSCONTRIB to $PATSHOME. >>>>>>> >>>>>>> The issue is that I tried compiling the SDL sample programs and, >>>>>>> while the ATS compiler compiles them just fine, I get errors like the >>>>>>> following from the resulting C source. >>>>>>> >>>>>>> $ make >>>>>>> "/usr/local/lib/ats2-postiats-0.3.13"/bin/patscc -I >>>>>>> "/usr/local/lib/ats2-postiats-0.3.13" -I >>>>>>> "/usr/local/lib/ats2-postiats-0.3.13"/ccomp/runtime -D_GNU_SOURCE - >>>>>>> I/usr/include/SDL2 -D_REENTRANT -o test00 test00.dats -L >>>>>>> "/usr/local/lib/ats2-postiats-0.3.13"/ccomp/atslib/lib -latslib - >>>>>>> lSDL2 >>>>>>> test00_dats.c:82:10: fatal error: SDL2/CATS/SDL.cats: No such file >>>>>>> or directory >>>>>>> #include "SDL2/CATS/SDL.cats" >>>>>>> ^~~~~~~~~~~~~~~~~~~~ >>>>>>> compilation terminated. >>>>>>> make: *** [Makefile:41: test00] Error 1 >>>>>>> >>>>>>> The same thing happens if I set $PATSCONTRIB to $PATSHOME/contrib. >>>>>>> Did I set something up incorrectly? Is this a problem with the library? >>>>>>> Is >>>>>>> this a Cygwin issue? >>>>>>> >>>>>> >>>>>> Could you check what is in those -I directories? In particular, where >>>>>> are the SDL2/CATS/SDL.cats files located, and what is your $PATSCONTRIB, >>>>>> does it have an SDL2 subdirectory? >>>>>> >>>>>> >>>>>>> Thanks in advance. >>>>>>> >>>>>> -- >>>>> 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/be4dd68f-82f5-4292-8b62-762a69bfcf9a%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/ats-lang-users/be4dd68f-82f5-4292-8b62-762a69bfcf9a%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> >>>> >>>> -- >>>> Matt Chelen >>>> >>>> -- >>>> 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/CAFh2Mmrdax0v18is7_9KVWeWa7wyG3X_k7NmU_3FhjOzKvnd0Q%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/ats-lang-users/CAFh2Mmrdax0v18is7_9KVWeWa7wyG3X_k7NmU_3FhjOzKvnd0Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Cheers, >>> Artyom Shalkhakov >>> >>> -- >>> 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/CAKO6%3DqiaTnM1KgXLrrftZPQFL5f94T%2BpTcOvQdgSigLA-xq5mg%40mail.gmail.com >>> <https://groups.google.com/d/msgid/ats-lang-users/CAKO6%3DqiaTnM1KgXLrrftZPQFL5f94T%2BpTcOvQdgSigLA-xq5mg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> >> -- >> Matt Chelen >> >> -- >> 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/CAFh2Mmr-Rxj6N8t%3D0QANDUdXA_qmRhWPV-NrfhpdgHdn4Kt8fA%40mail.gmail.com >> <https://groups.google.com/d/msgid/ats-lang-users/CAFh2Mmr-Rxj6N8t%3D0QANDUdXA_qmRhWPV-NrfhpdgHdn4Kt8fA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Cheers, > Artyom Shalkhakov > > -- > 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/CAKO6%3DqgS9enS4qti_q%3D6KzHjJk41HWo0gC-UReaAXuyQgQxXOA%40mail.gmail.com > <https://groups.google.com/d/msgid/ats-lang-users/CAKO6%3DqgS9enS4qti_q%3D6KzHjJk41HWo0gC-UReaAXuyQgQxXOA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- Matt Chelen -- 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/CAFh2MmoqoLDY8Dt%3Dq9pitNCCYzCXerSi5vWXOPcm6zdrr7yQmw%40mail.gmail.com.
