我想在我的項目中使用SRILM包。我已經成功地編譯了SRILM,現在有〜/ srilm/lib/i686-ubuntu中的靜態庫我在eclipse中創建了一個C++項目,並將libdstruct.a添加到庫中,並將其路徑設置爲搜索庫的目錄。但日食找不到我的圖書館! 下面的代碼是我在Eclipse中點擊構建項目按鈕時的輸出。正如你所看到的g ++說找不到-llibdstructEclipse沒有找到我的靜態庫
**** Build of configuration Debug for project test ****
make all
Building file: ../src/test.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o"src/test.o" "../src/test.c"
Finished building: ../src/test.c
Building target: test
Invoking: GCC C Linker
gcc -L/home/atp/srilm/lib/i686-ubuntu -o"test" ./src/test.o -llibdstruct
/usr/bin/ld: cannot find -llibdstruct
collect2: ld returned 1 exit status
make: *** [test] Error 1
我在Ubuntu上。我肯定路徑和文件權限是777. –
好吧,我自己找到了這個問題的原因。我應該使用-ldstrust而不是-llibdstruct! –