For roughly a week now, I've been having this issue where PATSCC 
successfully typechecks my file, but when it tries to compile it to C an 
error is produced due to GCC not seeing the values/functions that I am 
using.  These values and functions are declared in a separate file, which 
is staload-ed in properly.  After some testing, I was able to determine 
that when my code was inserted into the ATS-contrib SDL library code, no 
such errors were produced.  This most likely means that *the issue is with 
my Makefile, and not the code itself.*  If you'd like to see my code and/or 
the Makefile, it is available in my Github repository with is linked below.

For anyone who takes the time to try and answer my question, thank you so, 
so much.  And if you have any questions, just let me know.

*The link to my Github repo with full source code is available here: *
https://github.com/d4v3y5c0n3s/Goldelish-Engine

*###  Here's the error message:  ###*

In file included from g_audio_dats.c:15:
g_audio_dats.c: In function 'audio_init':
g_audio_dats.c:351:34: error: 'AUDIO_S16' undeclared (first use in this 
function)
 ATSINSmove(tmpref3, ATSPMVextval(AUDIO_S16)) ;
                                  ^~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:351:21: note: in expansion of macro 'ATSPMVextval'
 ATSINSmove(tmpref3, ATSPMVextval(AUDIO_S16)) ;
                     ^~~~~~~~~~~~
g_audio_dats.c:351:34: note: each undeclared identifier is reported only 
once for each function it appears in
 ATSINSmove(tmpref3, ATSPMVextval(AUDIO_S16)) ;
                                  ^~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:351:21: note: in expansion of macro 'ATSPMVextval'
 ATSINSmove(tmpref3, ATSPMVextval(AUDIO_S16)) ;
                     ^~~~~~~~~~~~
g_audio_dats.c:369:19: warning: implicit declaration of function 
'SDL_InitSubSystem' [-Wimplicit-function-declaration]
 ATSINSmove(tmp10, SDL_InitSubSystem(ATSPMVextval(SDL_INIT_AUDIO))) ;
                   ^~~~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:369:50: error: 'SDL_INIT_AUDIO' undeclared (first use in 
this function)
 ATSINSmove(tmp10, SDL_InitSubSystem(ATSPMVextval(SDL_INIT_AUDIO))) ;
                                                  ^~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:369:37: note: in expansion of macro 'ATSPMVextval'
 ATSINSmove(tmp10, SDL_InitSubSystem(ATSPMVextval(SDL_INIT_AUDIO))) ;
                                     ^~~~~~~~~~~~
g_audio_dats.c:401:19: warning: implicit declaration of function 
'Mix_OpenAudio' [-Wimplicit-function-declaration]
 ATSINSmove(tmp16, Mix_OpenAudio(ATSPMVi0nt(22050), 
ATSPMVextval(AUDIO_S16), ATSPMVi0nt(2), ATSPMVi0nt(4096))) ;
                   ^~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:433:19: warning: implicit declaration of function 
'Mix_QuerySpec' [-Wimplicit-function-declaration]
 ATSINSmove(tmp22, Mix_QuerySpec(ATSPMVrefarg1(ATSPMVptrof(tmpref2)), 
ATSPMVrefarg1(ATSPMVptrof(tmpref3)), ATSPMVrefarg1(ATSPMVptrof(tmpref4)))) ;
                   ^~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c: In function 'audio_finish':
g_audio_dats.c:669:27: warning: implicit declaration of function 
'Mix_CloseAudio' [-Wimplicit-function-declaration]
 ATSINSmove_void(tmpret25, Mix_CloseAudio()) ;
                           ^~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:284:39: 
note: in definition of macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
g_audio_dats.c: In function 'audio_sound_play':
g_audio_dats.c:718:19: warning: implicit declaration of function 
'Mix_PlayChannel' [-Wimplicit-function-declaration]
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                   ^~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:718:96: error: 'Mix_Chunk' undeclared (first use in this 
function)
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                                            
                    ^~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:718:42: note: in expansion of macro 'ATSPMVrefarg1'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                          ^~~~~~~~~~~~~
g_audio_dats.c:718:56: note: in expansion of macro 'ATSPMVptrof'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                        ^~~~~~~~~~~
g_audio_dats.c:718:68: note: in expansion of macro 'ATSSELrecsin'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                                    
^~~~~~~~~~~~
g_audio_dats.c:718:81: note: in expansion of macro 'ATSderef'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                                            
     ^~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:217:35: 
error: expected expression before ')' token
 #define ATSderef(pmv, hit) (*(hit*)pmv)
                                   ^
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:718:42: note: in expansion of macro 'ATSPMVrefarg1'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                          ^~~~~~~~~~~~~
g_audio_dats.c:718:56: note: in expansion of macro 'ATSPMVptrof'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                        ^~~~~~~~~~~
g_audio_dats.c:718:68: note: in expansion of macro 'ATSSELrecsin'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                                    
^~~~~~~~~~~~
g_audio_dats.c:718:81: note: in expansion of macro 'ATSderef'
 ATSINSmove(tmp27, Mix_PlayChannel(tmp28, 
ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, Mix_Chunk), 
Mix_Chunk, atslab__sample))), arg1)) ;
                                                                            
     ^~~~~~~~
g_audio_dats.c:748:19: warning: implicit declaration of function 
'Mix_GetError' [-Wimplicit-function-declaration]
 ATSINSmove(tmp36, Mix_GetError()) ;
                   ^~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:35: 
warning: assignment to 'atstype_ptrk' {aka 'void *'} from 'int' makes 
pointer from integer without a cast [-Wint-conversion]
 #define ATSINSmove(tmp, val) (tmp = val)
                                   ^
g_audio_dats.c:748:1: note: in expansion of macro 'ATSINSmove'
 ATSINSmove(tmp36, Mix_GetError()) ;
 ^~~~~~~~~~
g_audio_dats.c: In function 'audio_sound_pause':
g_audio_dats.c:845:27: warning: implicit declaration of function 
'Mix_Pause' [-Wimplicit-function-declaration]
 ATSINSmove_void(tmpret37, Mix_Pause(arg0)) ;
                           ^~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:284:39: 
note: in definition of macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
g_audio_dats.c: In function 'audio_sound_resume':
g_audio_dats.c:875:27: warning: implicit declaration of function 
'Mix_Resume' [-Wimplicit-function-declaration]
 ATSINSmove_void(tmpret38, Mix_Resume(arg0)) ;
                           ^~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:284:39: 
note: in definition of macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
g_audio_dats.c: In function 'audio_sound_stop':
g_audio_dats.c:905:27: warning: implicit declaration of function 
'Mix_HaltChannel' [-Wimplicit-function-declaration]
 ATSINSmove_void(tmpret39, Mix_HaltChannel(arg0)) ;
                           ^~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:284:39: 
note: in definition of macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
g_audio_dats.c: In function 'audio_music_play':
g_audio_dats.c:953:19: warning: implicit declaration of function 
'Mix_FadeInMusic' [-Wimplicit-function-declaration]
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                   ^~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:953:89: error: 'Mix_Music' undeclared (first use in this 
function)
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                                            
             ^~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:953:35: note: in expansion of macro 'ATSPMVrefarg1'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                   ^~~~~~~~~~~~~
g_audio_dats.c:953:49: note: in expansion of macro 'ATSPMVptrof'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                 ^~~~~~~~~~~
g_audio_dats.c:953:61: note: in expansion of macro 'ATSSELrecsin'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                             ^~~~~~~~~~~~
g_audio_dats.c:953:74: note: in expansion of macro 'ATSderef'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                                          
^~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:217:35: 
error: expected expression before ')' token
 #define ATSderef(pmv, hit) (*(hit*)pmv)
                                   ^
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:953:35: note: in expansion of macro 'ATSPMVrefarg1'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                   ^~~~~~~~~~~~~
g_audio_dats.c:953:49: note: in expansion of macro 'ATSPMVptrof'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                 ^~~~~~~~~~~
g_audio_dats.c:953:61: note: in expansion of macro 'ATSSELrecsin'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                             ^~~~~~~~~~~~
g_audio_dats.c:953:74: note: in expansion of macro 'ATSderef'
 ATSINSmove(tmp41, 
Mix_FadeInMusic(ATSPMVrefarg1(ATSPMVptrof(ATSSELrecsin(ATSderef(arg0, 
Mix_Music), Mix_Music, atslab__handle))), tmp42, ATSPMVi0nt(5000))) ;
                                                                          
^~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:35: 
warning: assignment to 'atstype_ptrk' {aka 'void *'} from 'int' makes 
pointer from integer without a cast [-Wint-conversion]
 #define ATSINSmove(tmp, val) (tmp = val)
                                   ^
g_audio_dats.c:983:1: note: in expansion of macro 'ATSINSmove'
 ATSINSmove(tmp49, Mix_GetError()) ;
 ^~~~~~~~~~
g_audio_dats.c: At top level:
g_audio_dats.c:1063:1: error: redefinition of 'audio_sound_pause'
 audio_sound_pause()
 ^~~~~~~~~~~~~~~~~
g_audio_dats.c:832:1: note: previous definition of 'audio_sound_pause' was 
here
 audio_sound_pause(atstkind_t0ype(atstype_int) arg0)
 ^~~~~~~~~~~~~~~~~
g_audio_dats.c: In function 'audio_sound_pause':
g_audio_dats.c:1064:1: error: number of arguments doesn't match prototype
 {
 ^
g_audio_dats.c:832:1: error: prototype declaration
 audio_sound_pause(atstkind_t0ype(atstype_int) arg0)
 ^~~~~~~~~~~~~~~~~
In file included from g_audio_dats.c:15:
g_audio_dats.c:1076:27: warning: implicit declaration of function 
'Mix_PauseMusic' [-Wimplicit-function-declaration]
 ATSINSmove_void(tmpret50, Mix_PauseMusic()) ;
                           ^~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:284:39: 
note: in definition of macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
g_audio_dats.c: In function 'audio_music_resume':
g_audio_dats.c:1106:27: warning: implicit declaration of function 
'Mix_ResumeMusic' [-Wimplicit-function-declaration]
 ATSINSmove_void(tmpret51, Mix_ResumeMusic()) ;
                           ^~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:284:39: 
note: in definition of macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
g_audio_dats.c: In function 'audio_music_stop':
g_audio_dats.c:1143:19: warning: implicit declaration of function 
'Mix_FadeOutMusic' [-Wimplicit-function-declaration]
 ATSINSmove(tmp53, Mix_FadeOutMusic(ATSPMVi0nt(5000))) ;
                   ^~~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c: In function 'audio_music_set_volume':
g_audio_dats.c:1195:53: error: 'MIX_MAX_VOLUME' undeclared (first use in 
this function)
 ATSINSmove(tmp56, atspre_mul_int_float(ATSPMVextval(MIX_MAX_VOLUME), 
arg0)) ;
                                                     ^~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:1195:40: note: in expansion of macro 'ATSPMVextval'
 ATSINSmove(tmp56, atspre_mul_int_float(ATSPMVextval(MIX_MAX_VOLUME), 
arg0)) ;
                                        ^~~~~~~~~~~~
g_audio_dats.c:1200:19: warning: implicit declaration of function 
'Mix_VolumeMusic' [-Wimplicit-function-declaration]
 ATSINSmove(tmp55, Mix_VolumeMusic(ATSPMVcastfn(float_to_int, 
atstkind_t0ype(atstype_int), tmp56))) ;
                   ^~~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c: In function 'audio_music_get_volume':
g_audio_dats.c:1257:60: error: 'MIX_MAX_VOLUME' undeclared (first use in 
this function)
 ATSINSmove(tmp58, atspre_g0int_mul_int(tmp59, 
ATSPMVextval(MIX_MAX_VOLUME))) ;
                                                            ^~~~~~~~~~~~~~
/home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: 
note: in definition of macro 'ATSINSmove'
 #define ATSINSmove(tmp, val) (tmp = val)
                                     ^~~
g_audio_dats.c:1257:47: note: in expansion of macro 'ATSPMVextval'
 ATSINSmove(tmp58, atspre_g0int_mul_int(tmp59, 
ATSPMVextval(MIX_MAX_VOLUME))) ;

-- 
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 ats-lang-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/52ce7b08-ceda-4342-991b-b81f36eb1b05%40googlegroups.com.

Reply via email to