如何解决链接器错误:无法解析外部命令 [英] How to solve linker error: cannot resolve the external command

查看:110
本文介绍了如何解决链接器错误:无法解析外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DATABASE_API CAlarmDatabase* GetAlarmDatabase();


我导出了这样的方法,但是当我使用类CAlarmDatabase的方法时,出现链接器错误"Cannot resolve the external command".
我只是不明白!


I export a method like this, but when I use the method of class CAlarmDatabase, I get a linker error "Cannot resolve the external command".
I just don''t get it!

推荐答案

该DLL将具有一个相应的LIB文件,您必须在调用该方法的项目中引用该文件. br/> 将LIB文件的名称放在Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies中.
The DLL will have a corresponding LIB file that you have to reference in the project in which the method is called.
Put the name of the LIB file in Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies.


除了超人回复外,还要检查您是否确实导出了该函数.这可以在例如工具Depends.exe(位于VS安装目录下的某个位置)
In addition to supermans reply, also check that you really exported the function. This can be done in e.g. the tool depends.exe (located somewhere under your VS install dir)


这篇关于如何解决链接器错误:无法解析外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆