歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CTorrent在Ubuntu下編譯錯誤解決

CTorrent在Ubuntu下編譯錯誤解決

日期:2017/2/28 16:13:34   编辑:Linux教程

1、invalid conversion from ‘const char*’ to ‘char*’

解決:

pn = strchr(p, PATH_SP);

改為

pn = (char *)strchr(p, PATH_SP);

2、 ‘PACKAGE_STRING’ was not declared in this scope

‘PACKAGE_BUGREPORT’ was not declared in this scope

解決:

fprintf(stderr,"%s Copyright: YuHong(992126018601033)",PACKAGE_STRING);

fprintf(stderr,"bug report: %s\n\n",PACKAGE_BUGREPORT);

替換為:

fprintf(stderr,"CTorrent devel Copyright: YuHong(992126018601033)");

fprintf(stderr,"bug report: [email protected]\n\n");

3、fatal error: openssl/sha.h: 沒有那個文件或目錄

缺少 openssl dev包,解決:安裝libssl-dev

sudo apt-get install libssl-dev

4、undefined reference to `SHA1_Init'

undefined reference to `SHA1_Update'

undefined reference to `SHA1_Final'

解決1:

1.確認你裝了openssl

2.g++ 後加上參數 -lssl

解決2:

或者/usr/lib/libssl.so加入程序library庫下

Eclipse CDT下設置g++參數的方法

Project->Properties->C/C++ Build->Setting->GCC C++ Linker->Miscellaneous->Linker Flag 處加上 -lssl

Copyright © Linux教程網 All Rights Reserved