c++ - 不断收到错误 LNK2019 : unresolved external symbol

标签 c++ linker icu unresolved-external

我使用的IDE是Visual Studio 2010 Professional,我使用的库是ICU用于 MSVC10 的 Win32 的 4C 4.8.1。

我已经按照Debug和Release的手册重新编译了所有的源代码,并且所有的测试都顺利通过。

然后我按照我使用 Boost 的方式进行操作。

我在 C/C++ > Additional Include Directories 中包含了 \includeProprieties 中,这似乎没问题。

我还在 Linker > Additional Library Directories 中包含了 \lib

但是,我不断收到 error LNK2019: unresolved external symbol

源代码:

#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.

最佳答案

除了设置额外的包含目录和库目录外,您还必须实际链接到库。转到 Project Properties -> Linker -> Input 并将名称写入 Additional dependencies 文本框中的 .lib。

关于c++ - 不断收到错误 LNK2019 : unresolved external symbol,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6895062/

相关文章:

windows-7 - 进程未结束时该怎么办

c++ - 编译与静态链接

c - 使用 gcc 在 C 中链接

javascript - 使用 Number.toLocaleString() 的货币格式差异

ICU 可以在 CP 850 中转换代码 1-31 吗?

c++ - binary_search 不适用于 vector <string>

c++ - int 和元组的静态 STL 映射返回 0

c++ - 链接文件出错,VS 2015 中出现错误 LNK2005

c - ARM : How does objcopy know which sections from an elf to include in a binary or ihex?

iPhone 应用因使用 ICU(Unicode 扩展)而被拒绝