链接我的库时未解析的外部符号 [英] Unresolved external symbol when linking my library

查看:228
本文介绍了链接我的库时未解析的外部符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编译了我自己的库文件(.lib)与VS2010,但当我尝试引用像

I've compiled my own library file(.lib) with VS2010, but when I try to reference it like

#pragma comment(lib,"path/to/lib.lib")

符号...我做错了什么?
#pragma注释(lib,* .lib)为任何库工作到目前为止,我也尝试在设置下链接它,没有成功。

I keep getting unresolved external symbols...What am I doing wrong? the #pragma comment(lib, "*.lib") worked for any library so far, and I also tried linking it under settings, no succes.

推荐答案

1)打开VS命令控制台(Tools / Visual Studio命令提示符)。

1) Open a VS command console (Tools/Visual Studio Command Prompt).

2)使用 cd

2) Use cd command to change to the directory containing the library in question.

3)输入:

dumpbin /all my_lib_name.lib > lib.txt

替换 my_lib_name.lib 您的图书馆的名称。
(您需要将输出写入到大型库的文本文件 lib.txt

replacing my_lib_name.lib with the name of your library. (You'll want to write the output to a text file lib.txt for large libraries)

4)打开这个新创建的 lib.txt 以查看库的内容。
更多详细信息,请访问此处

4) Open this newly created lib.txt to view the contents of the library. More details can be found here.

这篇关于链接我的库时未解析的外部符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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