开发者

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开发者_如何学C 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?


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.


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.


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜