error: two or more data types in declaration of 'main'

Hi everyone, I had error when i run my program. My program is like

in my source program

#include LinuxCamera.h
class LinuxCamera
int main()
{
LinuxCamera cam;
cam.LinuxCamera::GetInstance()->Initialize(0);
cam.LinuxCamera::GetInstance()->LoadINISetting(ini);
}

my error is like
two or more data types in declaration of 'main'.. Why? If you know it, pls kindly share me. Thanks.
Last edited on
your class LinuxCamera should be in your header LinuxCamera.h, not in your main function. The error is because you said LinuxCamera is a class, but you declared it as a function header. If you want to have it in the main function, then put the full declaration of the class in main.

Gl
even though, If i put class LinuxCamera line inside main, it still got errors like expected initializer before 'cam'.
another error is 'cam' was not declared in this scope. How to solve it?
You just forgot semicolon after class LinuxCamera.
if i put semicolon behind it, i got error like "aggregate"main()::LinuxCamera cam" has incomplete type and cannot be defined.
Show content of LinuxCamera.h
Topic archived. No new replies allowed.