cudn't find the solution for the errors..

hi i'm trying to run a cloth simulation code in linux machine. it works well in windows but got the following errors in linux.

ClothSim.cpp:464: error: '<anonymous>' has incomplete type
ClothSim.cpp:464: error: invalid use of 'GLvoid'
ClothSim.cpp: In function 'int main(int, char**)':
ClothSim.cpp:464: error: too few arguments to function 'void init(<type error>)'
ClothSim.cpp:590: error: at this point in file

line 464 is : void init(GLvoid)
line 590 is : init();

is it sth to do with the opengl initialization?? cud someone help me with it plz? thanks a lot...
closed account (Lv0f92yv)
void init(GLvoid) If this is your function declaration (not prototype), there must be two things at minimum provided: A type and a variable.

void myfunc( type var ) where type is any datatype (a class, struct or primitive type like int, char, double etc) and var is the variable name passed in as a parameter.

Edit: Usually a good idea to work on the first error generated by the compiler, as it tends to throw the compiler off for the rest of your code. Fix this error then see what you get for other errors (if any).
Last edited on
but that's the syntax i think i checked in the opengl tutorials..the same code works in windows and i did try passing a parameter but its gives the same errors.. i found out a new thing that the old gcc compiler doesn't support it and the new one does...probably that's the problem i guess...i have another doubt too... in this program there are global declarations like #define DAMP 45..if i don't want to use '#define' cud someone tell me the alternative way for global declarations?? thanks...
closed account (Lv0f92yv)
A global variable declaration can be done outside of your main() function.

1
2
3
4
5
6
7
int global = 5;

int main()
{
    ...
    cout << global;
}


As for the function errors, post more of your code so we can see the context of your error.
Topic archived. No new replies allowed.