ellabrella
PKMN Trainer
- 57
- Posts
- 6
- Years
- She/It
- Seen Feb 27, 2025
hi all,
i'm adding a new .h and .c file to my pokeemerald project. the files are pretty simple; the .h file has an include guard, an enum, some structs, some extern const arrays and a function declaration. the .c file contains the definition for those const arrays (included as a src/data file; i get the same issue even if i don't include it so i don't think that file has any issues) and the function. the .h file is included by a few files that reference its variables. i am pretty much certain that there are no syntax errors or typos, no semicolons in the wrong place or anything like that, and to my knowledge nothing i've written outside functions is anything which wouldn't be allowed, as it's all just variable stuff.
whenever i compile it, no matter what i try to do, i get a ton of errors and warnings. they say things like "syntax error before s8" or "before [variable name]", "array assumed to have one element", and "type defaults to int". it seems like all the errors are in places where i've written "s8" or "u8" or "u16". when i change the first instance of s8 to "int" instead, the first error goes away, and it complains about the next line's s8 instead. also, if i include graphics.h in my .c file, i start getting these same errors about variables in THAT file as well.
so it seems like my file just doesn't recognise the variable types that pokeemerald uses. does anyone have a guess as to why this would be? is there something in particular i have to do when adding a new file like this to get it to work?
i have pastebin links for the include/mix_mega.h and src/mix_mega.c files, i didn't include the src/data/mix_mega.h file as it is very large and doesn't seem to be relevant anyway.
src/mix_mega.c: https://pastebin.com/0a7f06xX
include/mix_mega.h: https://pastebin.com/Ja5Tx60Y
i'm adding a new .h and .c file to my pokeemerald project. the files are pretty simple; the .h file has an include guard, an enum, some structs, some extern const arrays and a function declaration. the .c file contains the definition for those const arrays (included as a src/data file; i get the same issue even if i don't include it so i don't think that file has any issues) and the function. the .h file is included by a few files that reference its variables. i am pretty much certain that there are no syntax errors or typos, no semicolons in the wrong place or anything like that, and to my knowledge nothing i've written outside functions is anything which wouldn't be allowed, as it's all just variable stuff.
whenever i compile it, no matter what i try to do, i get a ton of errors and warnings. they say things like "syntax error before s8" or "before [variable name]", "array assumed to have one element", and "type defaults to int". it seems like all the errors are in places where i've written "s8" or "u8" or "u16". when i change the first instance of s8 to "int" instead, the first error goes away, and it complains about the next line's s8 instead. also, if i include graphics.h in my .c file, i start getting these same errors about variables in THAT file as well.
so it seems like my file just doesn't recognise the variable types that pokeemerald uses. does anyone have a guess as to why this would be? is there something in particular i have to do when adding a new file like this to get it to work?
i have pastebin links for the include/mix_mega.h and src/mix_mega.c files, i didn't include the src/data/mix_mega.h file as it is very large and doesn't seem to be relevant anyway.
src/mix_mega.c: https://pastebin.com/0a7f06xX
include/mix_mega.h: https://pastebin.com/Ja5Tx60Y