J´ai commencé un prog en c et la je le transcris en c++ mais je commence a proramme en c++ et j´arrive pas a me servir des methodes de mes objets. Ca bloque a la compil. Ce serait sympa ke kelkun y jette un cout d´oeil
voila le code:
//////////////////************* File main.cpp *******************/////////////
- include "main.h"
int main()
{
pacman2.x = 100;
pacman2.y = 60;
animation.initAnimation ( pacman2);
return 0;
}
//////////////************* File Animation.cpp ****************//////////////////////
- include "Animation.h"
void Animation::initAnimation ( Sprite pacman2)
{
pacman = pacman2;
}
//////////////////////********* File Animation.h **********///////////////////////
- ifndef __ANIMATION_H_
- define __ANIMATION_H_
- include "gba.h"
typedef struct
{
u16 x; //x and y position on screen
u16 y;
u16 spriteFrame[3]; //animation frame
int activeFrame; //which frame is active
}Sprite;
class Animation
{
public:
Sprite pacman;
void initAnimation(Sprite pacman2);
private:
};
- endif
/////////////////////********** File main.h **************/////////////////////////
- ifndef __MAIN_H_
- define __MAIN_H_
- include "Animation.h"
Sprite pacman2;
Animation animation;
- endif
/////////********/////////////////////////
le message d´erreur est undefined reference to ´Animation::initAnimation(Sprite)´ voila merci d´avance.....