不断收到错误 LNK2019:无法解析的外部符号
我使用的IDE是Visual Studio 2010 Professional,我使用的库是ICU4C 4.8.1 MSVC10 的 Win32。
我已经按照手册重新构建了 Debug 和 Release 的所有源代码,并且所有测试都成功通过。
然后我按照我使用 Boost 的方式进行操作。
我将 \include 包含在 C/C++ > 中Proprieties 中的附加包含目录,这似乎没问题。
我还在 Linker > 中包含了 \lib其他库目录。
但是,我不断收到错误 LNK2019:无法解析的外部符号
。
源代码:
#include <unicode/uchar.h>
int main () {
UBool b = u_isprint('c');
return 0;
}
错误
1>ClCompile:
1> Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol _u_isprint_48 referenced in function _main
1>C:\Users\ ... \Documents\Visual Studio\Finger-Printing-Non-ASCII\Debug\Finger-Printing-Non-ASCII.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
The IDE I use is Visual Studio 2010 Professional, and the library I use is ICU4C 4.8.1 for Win32 for MSVC10.
I have rebuilt all the source codes according to the manual for both Debug and Release, and all tests are successfully passed.
Then I do in the way I do with Boost.
I included \include in C/C++ > Additional Include Directories in Proprieties, which seems to be fine.
I also included \lib in Linker > Additional Library Directories.
However, I keep getting error LNK2019: unresolved external symbol
.
Source Code:
#include <unicode/uchar.h>
int main () {
UBool b = u_isprint('c');
return 0;
}
Error
1>ClCompile:
1> Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol _u_isprint_48 referenced in function _main
1>C:\Users\ ... \Documents\Visual Studio\Finger-Printing-Non-ASCII\Debug\Finger-Printing-Non-ASCII.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了设置额外的包含目录和库目录之外,您还必须实际链接到库。转到项目属性 ->链接器->在其他依赖项文本框中输入名称并将其写入.lib。华泰
Apart from setting additional include directories and library directories, you have to actually link to the library. Go to Project Properties -> Linker -> Input and write the name to the .lib in Additional dependencies textbox. HTH