Can't create Object of Class

Hey folks,

First of all: Thank you guys for this amazing board! SO far the tutorials are grate and worked for me but here is a little something that I just can't explain myself why it doesn't work:

Here we go:

I've got an class called ArgumentRead and now I want to create an Object of it with:

ArgumentRead argumentRead;

so far so good. In the next line I wanna call a function of the class like this:

argumentRead::startTranslation(argc, argv)

I've seen this way thousands of times in other code but for some reason I get the Error: 'argumentRead' is not a class or namespace.

Can anyone tell me what might be wrong? If you need more of the code just let me know and I'll upload it ASAP

Cheers and thank you!

Lenny
To call a function of a class instance, you need to use a . [dot]
argumentRead.startTranslation(argc,argv);

If you do like this:
argumentRead::startTranslation(argc,argv)
your are trying to call a static function of the class argumentRead(which is not a class)
or you are trying to call a function within namespace argumentRead(which doesn't exist)

Just replace :: by . and the problem is solved.

regards, hannesvdc
Last edited on
Ahhhhhhhhhhh crap.

I knew it must have been something easy like that. Thanks! I'll probably just go for my doctor and ask for some glasses.

Thanks for the fast answer!!!
But here I got another problem that freaks me out.

I included the class help with
#include <help.h>

The help.h sits in the same folder like all the other stuff and had been added to the project by codeBlocks. For any reason it gives me the Error: Help.h: no such file or directory.

I had that Error before, closed CodeBlocks, started it again and the Error was gone. I saved all the files in CodeBlocks but this time nothing seems to do the trick. Any help would be appreciated.
Ah nevermind. I figured it out. This time I just forget to create an Object of the class ... I probably should do something else for today ...
Topic archived. No new replies allowed.