Compilation error

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

Parents
  • can you help me ?

    Nobody can, because your description of the problem is critically incomplete.

    Where is the definition of struct GameDriver supposed to be? Which lines of your out-of-context snippet are 85 and 86? Where is the declaration of rom_first_region?

    Your problem most likely has nothing to do with C++, nor MSVC. It is that the definition of that struct was not visible at the point that snippet was compiled.

    Oh, and could you really not think of any better title for your post than "Compilation problem"? That would match about half the entire topic range of this forum!

Reply
  • can you help me ?

    Nobody can, because your description of the problem is critically incomplete.

    Where is the definition of struct GameDriver supposed to be? Which lines of your out-of-context snippet are 85 and 86? Where is the declaration of rom_first_region?

    Your problem most likely has nothing to do with C++, nor MSVC. It is that the definition of that struct was not visible at the point that snippet was compiled.

    Oh, and could you really not think of any better title for your post than "Compilation problem"? That would match about half the entire topic range of this forum!

Children
More questions in this forum