Linking error in MSVC 2008
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.
Okay I found the problem, file1.cpp was actually file.c. Only I enclosed that in
extern C { .. }
it is working fine.
精彩评论