void (timer::)()' does not match `void (*) ?
Bonjour,
en francais courant, ca veut dire quoi ça?
Citation:
error: argument of type `void (timer:: )()' does not match `void (*)()'
||=== Build finished
je comprend que je dois envoyer qq chose du genre void(*) mais comment je fait cela?
merci d'avance :P
dans l'idée, je comprend mais ...
pas bien clair tout cela :cry:
je développe un chouia :
j'ai le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
class timer{
#include <allegro.h>
#include <time.h>
// Member Variables
private:
protected:
static timer* m_ptimer;
int m_iTarget_Cycle;
int m_iLast_fps;
int m_iFrame_Counter;
int m_iActual_Cycle;
void m_vtarget_incrementor();
void m_vCount_Frames();
public:
timer();
virtual ~timer();
} |
et :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| #include "timer.h"
timer *timer::m_ptimer = NULL;
timer::timer(){
install_timer();
LOCK_VARIABLE(m_iTarget_Cycle);
LOCK_VARIABLE(m_iLast_fps);
LOCK_VARIABLE(m_iFrame_Counter);
LOCK_FUNCTION(m_vtarget_incrementor);
LOCK_FUNCTION(m_vCount_Frames);
install_int_ex(m_vtarget_incrementor, BPS_TO_TIMER(60));
install_int_ex(m_vCount_Frames, BPS_TO_TIMER(1));
m_iActual_Cycle = 0;
m_iTarget_Cycle = 0;
}
timer::~timer(){
}
void timer::m_vtarget_incrementor()
{
m_iTarget_Cycle++;
};
void timer::m_vCount_Frames()
{
m_iLast_fps = m_iFrame_Counter;
m_iFrame_Counter = 0;
}; |
a la compile, le pb est le suivant :
Citation:
timer.cpp||In constructor `timer::timer()' :
\timer.cpp|25|error: argument of type `void (timer:: )()' does not match `void (*)()'|
timer.cpp|26|error: argument of type `void (timer:: )()' does not match `void (*)()'|
donc, erreur sur install_int_ex().
si je rend mes fonctions void m_vtarget_incrementor(); et void m_vCount_Frames();static, je doit aussi mettre les différents membres utilisés en static, et ca, je veux pas ......
:arf:
peut etre est ce la bonne question
je sais pas en fait,
je vais voir si je peut pas les ressortir
:koi:
à suivre
ca marche sans classe timer
bon, fait le timer sans classe et ça marche.
j'aurais préféré avoir une jolie classe timer mais je vais pas faire le difficile.
merci pour la bonne question ;)