Cannot call member function without object = C++

前端 未结 5 1420
梦谈多话
梦谈多话 2021-02-13 07:17

I am brushing up again and I am getting an error:

Cannot call member function without object.

I am calling like:

FxString text = table.GetEntry(o         


        
5条回答
  •  渐次进展
    2021-02-13 07:45

    Your method isn't static, and so it must be called from an instance (sort of like the error is saying). If your method doesn't require access to any other instance variables or methods, you probably just want to declare it static. Otherwise, you'll have to obtain the correct instance and execute the method on that instance.

提交回复
热议问题