1
我試圖編譯它使用的hunspell庫用gcc這種純粹的C源代碼(4.6.3版本)編譯來源:鏈接問題在Ubuntu 10.10使用中的hunspell庫
#include <stdlib.h>
#include <stdio.h>
#include <hunspell/hunspell.h>
int main() {
Hunhandle *spellObj = Hunspell_create("/home/artem/en_US.aff", "/home/artem/en_US.dic");
char str[60];
scanf("%s", str);
int result = Hunspell_spell(spellObj, str);
if(result == 0)
printf("Spelling error!\n");
else
printf("Correct Spelling!");
Hunspell_destroy(spellObj);
return 0;
}
隨着命令:
gcc -lhunspell-1.3 example.c
但我有一些問題鏈接:
/tmp/cce0QZnA.o: In function `main':
example.c:(.text+0x22): undefined reference to `Hunspell_create'
example.c:(.text+0x52): undefined reference to `Hunspell_spell'
example.c:(.text+0x85): undefined reference to `Hunspell_destroy'
collect2: ld returned 1 exit status
另外,我檢查/usr/include/hunspell/
文件夾中,文件hunspell.h存在幷包含來自我的源的所有函數。
我在做什麼錯了,爲什麼我不能編譯這個源代碼?
你是對的,謝謝! –