【发布时间】:2013-05-08 21:36:13
【问题描述】:
我搜索并找到了一堆关于使用 Hunspell 的文章,但到目前为止,没有一篇对我有真正的帮助。 C++ - Using HunSpell 1.3.2 with Visual Studio 2010 似乎正是我想要做的,但是在遵循问题、答案和链接材料之后,我仍然遇到问题。
基本上,我对 C++ 还很陌生,并且正在尝试学习如何将 Hunspell 整合到我正在开发的应用程序中。由于这对我来说是新的,我试图从创建一个简单的控制台应用程序开始,然后从那里开始。
这是我到目前为止所做的(同样,我已经按照链接问题中列出的所有步骤)
#include "stdafx.h"
#include <iostream>
#include <string>
#include <hunspelldll.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
Hunspell *spellObj = (Hunspell *)hunspell_initialize("HunSpell-dic\\en_us.aff",
"HunSpell-dic\\en_us.dic");
char str[60];
cin >> str;
int result = hunspell_spell(spellObj, str);
if (result==0)
cout << "Spelling Error!";
else
cout << "Correct Spelling!";
hunspell_uninitialize(spellObj);
return 0;
}
我已将路径添加到我的配置属性和链接器,但是在构建时,我收到以下错误:
Error 1 error LNK2019: unresolved external symbol __imp__hunspell_uninitialize referenced in function _wmain C:\Users\owner\Documents\My Code Vault\Sandbox\2010Sandbox\Console_Spellcheck\Console_Spellcheck.obj Console_Spellcheck
Error 2 error LNK2019: unresolved external symbol __imp__hunspell_spell referenced in function _wmain C:\Users\owner\Documents\My Code Vault\Sandbox\2010Sandbox\Console_Spellcheck\Console_Spellcheck.obj Console_Spellcheck
Error 3 error LNK2019: unresolved external symbol __imp__hunspell_initialize referenced in function _wmain C:\Users\owner\Documents\My Code Vault\Sandbox\2010Sandbox\Console_Spellcheck\Console_Spellcheck.obj Console_Spellcheck
Error 4 error LNK1120: 3 unresolved externals C:\Users\owner\Documents\My Code Vault\Sandbox\2010Sandbox\Debug\Console_Spellcheck.exe Console_Spellcheck
我敢肯定,这只是一件简单的事情,我错过了新手,但到目前为止,我一直在拉头发几个小时,但没有运气。任何建议都会得到无限的感激:-)
【问题讨论】: