rogcg
rogcg

Reputation: 10471

Identifier not found, even with argument-dependent lookup

I have this function:

short cmd_Draw2DPoly(short ThreeDmode, sds_point startpoint[]){...}

and I call it like this in another class

cmd_Draw2DPoly(0, startpoint);

and this error shows up

error C3861: 'cmd_Draw2DPoly': identifier not found, even with argument-dependent lookup

Does anybody know what is wrong?

Upvotes: 0

Views: 2577

Answers (3)

jszpilewski
jszpilewski

Reputation: 1632

Looking at your profile makes me think you are a Java developer and you may be not familiar with the concept of namespace in C++ that may open and close in the middle of a file (unlike Java package that is extended to entire file). So check for the presence of such a block that may enclose the definition of cmd_Draw2DPoly.

Upvotes: 1

Kirill V. Lyadvinsky
Kirill V. Lyadvinsky

Reputation: 99535

You cannot call methods of a class without specifying the instance of that class. So if cmd_Draw2DPoly isn't a standalone function and is not a member of "another class" you can't call it like that.

Upvotes: 1

AProgrammer
AProgrammer

Reputation: 52274

If you call your member function from another class, you need to pass the object on which to call it.

someObject.cmd_Draw2DPoly(0, startpoint);

Upvotes: 0

Related Questions