gph 是一个没有 getInstance 方法的单例类
class gph
{
public:
static void newfun();
static void newfun1();
//...//
private:
gph();
};
这个类被构建到一个静态库中
现在我有一个需要访问静态函数的 Dll。所以 A 类是 Dll 的一部分
我有一个 C++ 成员函数说
void A:: fun()
{
gph::newfun() ; //accessing a static function : gives linker errors
}
另一方面,如果我将 fun() 设为静态,它不会给我任何链接器错误。但我不想让 fun() 成为静态的