-
Notifications
You must be signed in to change notification settings - Fork 0
Common Decomp Errors (and How to Solve Them)
This page will discuss some common errors that occur when working on the pokeemerald decomp. I'll dissect the meaning and explain the ways in which they're typically addressed.
- Identifier Undeclared
- Multiple Definitions
- Excess Elements in Scalar Initializer
- Excess Elements in Array Initializer
- Unsupported Color Type
Alternatively, Ctrl+F for a small part of your error message.
src/battle_script_commands.c: In function `Cmd_moveend':
src/battle_script_commands.c:5535: `BattleScript_MyNewEffect' undeclared (first use in this function)
src/battle_script_commands.c:5535: (Each undeclared identifier is reported only once
src/battle_script_commands.c:5535: for each function it appears in.
This means the function or variable mentioned is not recognized by the compiler. This could be for a handful of reasons like:
- A typo in the name
- Never declaring the function
- Not including the right header file
- Double check the function or variable name for typos anywhere it is mentioned
- If this is in code you found elsewhere (via
git pull
or copy/paste for example), make sure you also find the declaration and definition in the source and place that in your code as well. - Find the header (.h) file the function or variable is declared in and add an include statement for it at the top of your .c file:
#include "<file_name>"
where <file_name> is the relevant header file's name.
src/data/object_events/berry_tree_graphics_tables.h:85: redefinition of gBerryTreePaletteTagTable_Pecha'
src/data/object_events/berry_tree_graphics_tables.h:1: gBerryTreePaletteTagTable_Pecha' previously defined here
This means you're defining a function or variable more than once (you can only have definition per declaration). The most common reasons this occurs are:
- Copy/paste errors or typos
- Including a .c file or the same .h file twice
- Writing a .h file without header guards
- Double check that you haven't pasted or merged in a 2nd definition of a function or variable
- Never #include a .c file. If you need to use a function in that file, include the corresponding .h file.
- Make sure all new .h files have header guards.
src/ui_test.c:38: warning: excess elements in scalar initializer after `gCursorGfx'
src/ui_test.c:39: warning: excess elements in scalar initializer after `gCursorPal'
This means you're trying to assign an array to a variable that isn't an array.
- Add
[]
to the variable definition, like:u16 gCursorGfx[]
instead ofu16 gCursorGfx
.
src/data/pokemon/evolution.h:224: warning: excess elements in array initializer after `gEvolutionTable[133]'
This means your array has a fixed size, but you've added elements to it so it exceeds the fixed size.
- If the array size is tied to a constant e.g
[SPECIES_COUNT]
, ensure you modify the constant to account for your additions. - If the array size is tied to a hardcoded number e.g.
[4]
, simply increase the hardcoded value.
"graphics/battle_interface/ball_display.png" has an unsupported color type.
The image "graphics/battle_interface/ball_display.png" does not contain a palette.
make: *** [Makefile:330: graphics/battle_interface/ball_display.4bpp] Error 1
This means you're trying to use an image that is not indexed properly.
Go back to your graphics editor of choice and make sure the color mode of the image is saved as "indexed."