gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > linking

#8741 - mlequim - Fri Jul 18, 2003 11:12 pm

Hi there,
I have a curious bug, when linking I have the error

"Multiple definition of 'OAM'"
but this pointer was defined only once in a ".h" file.

and it can't be defined more because of the

#ifndef SPRITE_H
#define SPRITE_H
...
blablabla
...
#endif

has someone an idea ?
thanks in advance, Michel

#8743 - Nessie - Fri Jul 18, 2003 11:14 pm

You might refer to this recent topic...which is probably of a similar nature to the problem you are having.

http://forum.gbadev.org/viewtopic.php?t=1701

#8744 - mlequim - Fri Jul 18, 2003 11:26 pm

thanks, i will try to debug with these explanations on your link :O)

#8807 - johnny_north - Sun Jul 20, 2003 5:49 pm

If you didn't find the fix, remember this. Sometimes if you are missing a ";" or making another syntax error, the compiler starts to interpret things oddly. It might think that you're redeclaring OAM when you are just using the variable. If the line error happens when you are trying to make use of the OAM variable its a good sign that this is happening.

#8818 - mlequim - Sun Jul 20, 2003 10:06 pm

h?h?, the explanations on the thread was good, my error was to
initialise and d?clare in one line in .h file, my compiler didn't like it.

thanks :Op