Hello,
I try to develop on SNES with PVSNESLIB and as long as i use a single code file, everything compile correctly.
I would like to organise my code in multiple file but i didn't find a way to compile it.
For example, i have 3 files :
SimpleSprite.h
Simpleprite.c :
main.c :
This code produce an error when SimpleSpriteInit() is called :
SimpleSprite.obj:SimpleSprite.asm:40: FIX_LABELS: Label "test" was defined more than once.
mn test islsl 0 islfl 0
Here is the file of wla that produce it :
https://github.com/optixx/snes-sdk/blob ... nk/write.c
Do you have informations about that and how can i solve it ?
Thanks in advance for you help.
I try to develop on SNES with PVSNESLIB and as long as i use a single code file, everything compile correctly.
I would like to organise my code in multiple file but i didn't find a way to compile it.
For example, i have 3 files :
SimpleSprite.h
Code:
#ifndef SIMPLESPRITE_H
#define SIMPLESPRITE_H
unsigned char test;
void SimpleSpriteInit();
#endif
#define SIMPLESPRITE_H
unsigned char test;
void SimpleSpriteInit();
#endif
Simpleprite.c :
Code:
#include "SimpleSprite.h"
void SimpleSpriteInit()
{
test = 'a';
}
void SimpleSpriteInit()
{
test = 'a';
}
main.c :
Code:
#include "SimpleSprite.h"
#include <snes.h>
extern char gfxpsrite, gfxpsrite_end;
extern char palsprite, palsprite_end;
int main(void) {
SimpleSpriteInit(); // ERROR HERE
consoleInit();
oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, (&palsprite_end-&palsprite), 0, 0x0000, OBJ_SIZE32);
oamSet(0, 100, 100, 3, 0, 0, 0, 0);
oamSetEx(0, OBJ_SMALL, OBJ_SHOW);
setMode(BG_MODE1,0); bgSetDisable(0); bgSetDisable(1); bgSetDisable(2);
setScreenOn();
while(1) {
WaitForVBlank();
}
return 0;
}
#include <snes.h>
extern char gfxpsrite, gfxpsrite_end;
extern char palsprite, palsprite_end;
int main(void) {
SimpleSpriteInit(); // ERROR HERE
consoleInit();
oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, (&palsprite_end-&palsprite), 0, 0x0000, OBJ_SIZE32);
oamSet(0, 100, 100, 3, 0, 0, 0, 0);
oamSetEx(0, OBJ_SMALL, OBJ_SHOW);
setMode(BG_MODE1,0); bgSetDisable(0); bgSetDisable(1); bgSetDisable(2);
setScreenOn();
while(1) {
WaitForVBlank();
}
return 0;
}
This code produce an error when SimpleSpriteInit() is called :
SimpleSprite.obj:SimpleSprite.asm:40: FIX_LABELS: Label "test" was defined more than once.
mn test islsl 0 islfl 0
Here is the file of wla that produce it :
https://github.com/optixx/snes-sdk/blob ... nk/write.c
Do you have informations about that and how can i solve it ?
Thanks in advance for you help.