2014-12-28 00:00:00
来 源
中存储网
Ubuntu
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,%

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: %snn",PACKAGE_BUGREPORT);

替换为:

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

fprintf(stderr,"bug report: linux@wwwnn");

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

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。