我的一个工程里面有一个exe(main.exe),两个dll(inout.dll和contrl.dll),这些本来都连接好的了,原来是main.exe调用了两个dll。两个dll之间没有任何关系。
我现在想设计为contrl.dll能调用inout.dll。然后在contrl.dll里定义inout.dll的一个类对象,然后让main.exe也能用它,当然contrl.dll也能用。
我这样设计过
在contrl.dll里面的global.cpp定义了
CKey *ugwc1;
在global.h定义
extern __declspec(dllexport) CKey *ugwc1;
在main.exe里面的main.cpp这样引用它:
extern __declspec(dllimport) CKey *ugwc1;
ugwc->delay_us(50);
编译时出现了这样的错误提示:
main.obj : error LNK2001: unresolved external symbol "class CKey *ugwc1" (?ugwc1@@3PAVCKey@@A)
Release/BondMain.exe : fatal error LNK1120: 1 unresolved externals请高手们帮忙解决!小弟万分感激!