开发者

Unreferenced external symbol during DLL function call

I'm having problems in implementing a class in a DLL in the same way it is explained here . I have my interface with all the methods declared as virtual, I have my class that implements the interface and I have the method that should create the object of the class. The problem is here, when I try to use it I get a "unreferenced external symbol" error. Why?

class IXYZ
{
    virtual void XXX() = 0;
};

class XYZ : public IXYZ
{
    void XXX();
}

#ifdef __cplusplus
    extern "C" __declspec(dllexport) IXYZ* __stdcall GetIXYZ();
#endif
开发者_如何学Python

and I use it inside my win32 program with:

IXYZ *myvar = GetIXYZ();

In my exe program I've included the .h file of the dll


If you've correctly defined the function in the DLL, and it is exported properly, then the only plausible explanation is that there is something wrong with your use of the .lib file in the application that uses the DLL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜