rafikkk
12-08-2004, 01:04 PM
Hello. This is part of my code and I have two problem with that.
void myLayer( void )
{
...
glui->add_button(" OBLICZ " ,0,trapezy) ;
...
}
void trapezy()
{
dx = (xk - xp) /N;
for (i=1; i<N; i++)
s +=f(xp + i * dx);
s = (s + (f(xp) + f(xk)) /2)*dx;
}When I'm compiling I have these errors:
error C2065: 'trapezy' : undeclared identifier
error C2373: 'trapezy' : redefinition; different type modifiers
When I do that delete this line:
glui->add_button(" OBLICZ " , 0,trapezy) ;everything is ok and program works ok, so I'm doing somethin wrong with "glui->add_button" function.
Can someone tell me what's wrong with that?
thanks a lot, bye
void myLayer( void )
{
...
glui->add_button(" OBLICZ " ,0,trapezy) ;
...
}
void trapezy()
{
dx = (xk - xp) /N;
for (i=1; i<N; i++)
s +=f(xp + i * dx);
s = (s + (f(xp) + f(xk)) /2)*dx;
}When I'm compiling I have these errors:
error C2065: 'trapezy' : undeclared identifier
error C2373: 'trapezy' : redefinition; different type modifiers
When I do that delete this line:
glui->add_button(" OBLICZ " , 0,trapezy) ;everything is ok and program works ok, so I'm doing somethin wrong with "glui->add_button" function.
Can someone tell me what's wrong with that?
thanks a lot, bye