MSVC 2008 中的链接错误
我的文件结构如下:
file1.h
extern const char *build_info[][3];
file1.cpp
#include "file1.h"
const char *build_info[][3] = {
{ "abc", "de", "feg" },
{ ... },
...
};
file2.cpp
// Use build_info
现在我在 MSVC 2008 Express 下遇到此错误
file2.obj : error LNK2001: unresolved external symbol "char const * (* build_info)[3]"
看起来我无法链接 file1.obj。知道如何验证:
- obj 是否已链接。
- 它定义了符号。
I have a file structure like this:
file1.h
extern const char *build_info[][3];
file1.cpp
#include "file1.h"
const char *build_info[][3] = {
{ "abc", "de", "feg" },
{ ... },
...
};
file2.cpp
// Use build_info
Now I am getting this erro under MSVC 2008 Express
file2.obj : error LNK2001: unresolved external symbol "char const * (* build_info)[3]"
Looks like I am not able to link file1.obj. Any idea how I can verify:
- Whether the obj is linked.
- It has the symbol defined.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧我发现问题了,file1.cpp 实际上是 file.c。只有我将其包含在
其中才能正常工作。
Okay I found the problem, file1.cpp was actually file.c. Only I enclosed that in
it is working fine.