Com proxy / stub LNK2001未解析的外部 [英] Com proxy/stub LNK2001 Unresolved externals
问题描述
我的平台Windows 8.1,Visual Studio社区2015 sp3
My platform Windows 8.1, Visual Studio Community 2015 sp3
我尝试创建代理,但是当我启动脚本make file(nmake)时,我得到下一个错误:
I try create proxy , but when I start script make file (nmake), I get next errors:
TestProvider.def:错误LNK2001:未解析的外部符号DllRegisterServer
TestProvider.def : error LNK2001: unresolved external symbol DllRegisterServer
................... .................................................. ............................. DllUnregisterServer
..................................................................................................DllUnregisterServer
我使用VS2015 x64 Native Tools命令提示符。
I use VS2015 x64 Native Tools Command Prompt.
Idl:(server.idl)
Idl: (server.idl)
import" unknwn.idl" ;
//界面IX
[
object,
uuid(32bb8323-b41b-11cf-a6bb-0080c7b2d682),
helpstring(" IX Interface"),
pointer_default(唯一)
]
$
界面IX:IUnknown
{
HRESULT FxStringIn([in,string] wchar_t * szIn);
HRESULT FxStringOut([out,string] wchar_t ** szOut);
};
[
uuid(d3011ee0-b997-11cf-a6bb-0080c7b2d682),
版本(1.0),
helpstring(" Component1.0 Type Library")
]
图书馆ServerLib
{
  ;  importlib(" stdole32.tlb");
//组件1
[
    uuid(0c092c29-882c-11cf-a6bb-0080c7b2d682),
    helpstring(" Component 1 Class")
]
coclass TEstProvider
{
    [默认]界面IX;
};
};
import "unknwn.idl" ;
// Interface IX
[
object,
uuid(32bb8323-b41b-11cf-a6bb-0080c7b2d682),
helpstring("IX Interface"),
pointer_default(unique)
]
interface IX : IUnknown
{
HRESULT FxStringIn([in, string] wchar_t* szIn) ;
HRESULT FxStringOut([out, string] wchar_t** szOut) ;
};
[
uuid(d3011ee0-b997-11cf-a6bb-0080c7b2d682),
version(1.0),
helpstring("Component1.0 Type Library")
]
library ServerLib
{
importlib("stdole32.tlb") ;
// Component 1
[
uuid(0c092c29-882c-11cf-a6bb-0080c7b2d682),
helpstring("Component 1 Class")
]
coclass TEstProvider
{
[default] interface IX ;
};
};
Def文件:(TestProvider.def)
Def file: (TestProvider.def)
LIBRARY TestProvider
EXPORTS
DllUnregisterServer PRIVATE
 &的DllRegisterServer NBSP;  PRIVATE
  DllCanUnloadNow       PRIVATE
 &的DllGetClassObject NBSP;  PRIVATE
LIBRARY TestProvider
EXPORTS
DllUnregisterServer PRIVATE
DllRegisterServer PRIVATE
DllCanUnloadNow PRIVATE
DllGetClassObject PRIVATE
生成文件:
iface.h proxy.c guids.c dlldata.c server.tlb:server.idl
midl / h iface.h / iid guids.c / proxy proxy.c / dlldata dlldata.c server.idl
dlldata.obj: dlldata.c
CL / c / DWin32 / DREGISTER_PROXY_DLL dlldata.c
proxy.obj:proxy.c
CL / c / DWin32 / DREGISTER_PROXY_DLL proxy.c
proxy.dll:dlldata.obj guids.obj proxy.obj TestProvider.def
link / dll /out:TestProvider.dll /def:TestProvider.def dlldata.obj guids.obj proxy.obj kernel32.lib rpcns4.lib rpcrt4.lib uuid.lib
iface.h proxy.c guids.c dlldata.c server.tlb : server.idl
midl /h iface.h /iid guids.c /proxy proxy.c /dlldata dlldata.c server.idl
dlldata.obj : dlldata.c
CL /c /DWin32 /DREGISTER_PROXY_DLL dlldata.c
proxy.obj : proxy.c
CL /c /DWin32 /DREGISTER_PROXY_DLL proxy.c
proxy.dll : dlldata.obj guids.obj proxy.obj TestProvider.def
link /dll /out:TestProvider.dll /def:TestProvider.def dlldata.obj guids.obj proxy.obj kernel32.lib rpcns4.lib rpcrt4.lib uuid.lib
推荐答案
哪个模块包含DllRegisterServer / DllUnregisterServer函数的实现?
Which module contains the implementation of DllRegisterServer/DllUnregisterServer functions?
这篇关于Com proxy / stub LNK2001未解析的外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!