我希望我的 DLL 导出一个函数转发到同名的其他模块函数。
例如:
#pragma comment(linker, "/export:func=module.func,@100")
效果很好。
但是如果我改用.DEF文件,链接器报错:LNK2001, unresolved external symbol func
EXPORTS
func = module.func @100
这两种方式不是等价的吗,问题出在哪里?
链接器不应该找出“func”符号。 期望将“func”转发到模块的“func”条目。
如果
module
是你的dll的名字,那么使用
EXPORTS
func @100
如果您导出的名称来自其他模块,请指定 使用 other_module.exported_name.
在 DLL 中导出名称
EXPORTS
func2=other_module.func1