解决编译snmp++出错

从www.agentpp.com/snmp_pp3_x/download_snmp_ppv3/download_snmp_ppv3.html下载的SNMP++v3.2.25

将src里的Makefile.linux改成Makefile

make

出现如下错误:g++ -D_XPG4_EXTENDED -Wall  -I../include -I./ -I../../libdes -I../../crypt/src/headers -I/usr/include -g -o auth_priv.o -c auth_priv.cpp
auth_priv.cpp: 在成员函数‘virtual int PrivDES::decrypt(const unsigned char*, unsigned int, const unsigned char*, unsigned int, unsigned char*, unsigned int*, const unsigned char*, unsigned int, long unsigned int, long unsigned int)’中:
auth_priv.cpp:1472:5: 错误:不能将‘void DES_ncbc_encrypt(const unsigned char*, unsigned char*, long int, DES_key_schedule*, unsigned char (*)[8], int)’的实参‘5’从‘unsigned char*’转换到‘unsigned char (*)[8]’

将unsigned char initVect[8];改成unsigned char (*initVect)[8]

将DES_CBC_ENCRYPT(buffer + k, out_buffer + k, symcbc, initVect, 8);

改成了des_ncbc_encrypt(buffer + k, out_buffer + k, 8, symcbc, initVect, DES_ENCRYPT);

之后出现如下错误:

g++ -D_XPG4_EXTENDED -Wall  -I../include -I./ -I../../libdes -I../../crypt/src/headers -I/usr/include -g -o auth_priv.o -c auth_priv.cpp
auth_priv.cpp: 在成员函数‘virtual int PrivDES::encrypt(const unsigned char*, unsigned int, const unsigned char*, unsigned int, unsigned char*, unsigned int*, unsigned char*, unsigned int*, long unsigned int, long unsigned int)’中:
auth_priv.cpp:1383:36: 错误:操作数类型‘unsigned char [8]’和‘unsigned char’对双目‘operator^’而言无效
auth_priv.cpp:1383:36: 错误:在求‘operator^=(unsigned char [8], unsigned char)’值时

之后编译成功了.snmp++目录下多了lib这个目录和目录下的4个文件.

编译成功了,但是不知道使用的时候会不会出现问题XDDDDDD

转载于:https://my.oschina.net/luyuhx/blog/74495

你可能感兴趣的:(解决编译snmp++出错)