c - 尝试在 C 中使用 Net-SNMP 时出现 LINK2019 错误
问题描述
因此,我尝试跟随 Net-SNMP 网站上的“snmpdemoapp”,尝试使用时出现 LINK2019 错误:
init_snmp("snmpdemoapp");
链接到演示应用程序:http://net-snmp.sourceforge.net/wiki/index.php/TUT: Simple_Application
如果我将此行注释掉,那么它将成功构建。我也在使用 Visual Studio 2015。我的参考资料中有 Net-SNMP 库。我也没有在“main()”函数中使用该库。
解决方案
通过包括以下内容修复了错误:
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "netsnmp.lib")
#pragma comment(lib, "netsnmpagent.lib")
#pragma comment(lib, "netsnmpmibs.lib")
#pragma comment(lib, "netsnmptrapd.lib")
#pragma comment(lib, "Advapi32.lib")
推荐阅读
- google-play - 应用包含不符合不当广告政策的内容。(谷歌播放)
- css - 弯曲每个项目相同的宽度/高度
- c# - ScriptableObject 抽象类:访问子变量
- windows - 无法从 Windows 中的 GitLab 克隆 git
- python - 如果条件将先前的值分配给 dict
- javascript - 茫然:点击无反应
- clojure - 如何打破 Clojure 中的 for 循环?
- java - 多对多关系中的Spring Boot GET请求
- database - 计算整个 Laravel 应用程序的数据库请求总数
- swift - 如何向我的 UITextField 添加占位符?(使用 Xcode 12)