Hello I have an error compiling this code :
int RomInSet (const struct GameDriver *gamedrv, const char* hash) { const struct RomModule *region, *rom; region = rom_first_region(gamedrv); //__RC à supprimer for (region = rom_first_region(gamedrv); region; region = rom_next_region(region)) for (rom = rom_first_file(region); rom; rom = rom_next_file(rom)) /* Compare all the available checksums */ if (hash_data_is_equal(ROM_GETHASHDATA(rom), hash, 0)) return 1; return 0; }
the error is :
HardPinMameSrc\audit.c(85): error: #167: argument of type "const struct GameDriver *" is incompatible with parameter of type "const struct GameDriver *" HardPinMameSrc\audit.c: region = rom_first_region(gamedrv); //__RC à supprimer HardPinMameSrc\audit.c: ^ HardPinMameSrc\audit.c(86): error: #167: argument of type "const struct GameDriver *" is incompatible with parameter of type "const struct GameDriver *" HardPinMameSrc\audit.c: for (region = rom_first_region(gamedrv); region; region = rom_next_region(region))
this code compile without error with visual c++. can you help me ?
thanks
best regards Renaud
Unfortunately the description is still somewhat incomplete, but that's because this error is tricky enough that it's hard to know what's necessary to know and what isn't.
Note how the error message claims a conflict between two datatypes, but prints the exact same string to describe those types. That implies that this exact same string must have had two different meanings at different points of the compiled source.
By far the most likely ways for that to happen are if
a) at least some part of the code (e.g. the prototype of rom_first_region()) referred to struct GameDriver before that struct was actually defined, or
b) you included the definition of struct GameDriver multiple times, but it expanded to different structures, e.g. because the MESS macro has switched states in between.
Your best bet right now is to boil down your problem case to the smallest possible example case you can come up with. Replace all #includes by their respective files, remove all parts that leave the error message intact. Go on until every single line contributes to the problem. If the problem isn't self-evident by then, post the remaining example case here.