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

Jan 30, 2013 at 6:14am
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 Jan 30, 2013 at 6:56am
Jan 30, 2013 at 6:30am
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
Jan 30, 2013 at 6:59am
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?
Jan 30, 2013 at 7:15am
You just forgot semicolon after class LinuxCamera.
Jan 30, 2013 at 7:36am
if i put semicolon behind it, i got error like "aggregate"main()::LinuxCamera cam" has incomplete type and cannot be defined.
Jan 30, 2013 at 7:57am
Show content of LinuxCamera.h
Topic archived. No new replies allowed.