makemakeinstall时出现错误和警告的修正Aspek1.4更新⽇志
⼀、make && make install时出现的警告、错误及其修正
错误及警告:
charts.cpp:475:1: warning: deprecated conversion from string constant to 'char*'
裙子款式/usr/include/c++/4.5/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Plea u a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning u -Wno-deprecated.
../../include/maps.h:33:9: error: an explicit specialization must be preceded by 'template <>'
../../include/charts.h:108:9: error: an explicit specialization must be preceded by 'template <>'
../../include/uchart.h:439:10: error: 'str' was not declared in this scope
../../include/uchart.h:476:9: error: an explicit specialization must be preceded by 'template <>'
../../include/uchart.h:569:9: error: an explicit specialization must be preceded by 'template <>'
../../include/sqldb.h:238:10: warning: deprecated conversion from string constant to 'char*'
daemon.cpp:97:18: warning: deprecated conversion from string constant to ‘char*’
daemon.cpp: In function ‘int LoadDaemonConfig(const char*, int)’:
daemon.cpp:244:36: warning: deprecated conversion from string constant to ‘char*’
修正:
(1)warning: deprecated conversion from string constant to ‘char*’
isos编译的时候,这个警告影响编译通过。
解决⽅法:把 char * 改成 static const char * 的话这个 Warning 就不会出现了。
charts.cpp :368 const char *sgml;
(2)../../include/charts.h:108
107 namespace STL_EXT_NAMESPACE {
108 template<> struct hash<CWord> {
同类错误修改同理。
错误:
../include/charts.h:93:38: error: 'strncpy' was not declared in this scope
../include/charts.h:98:38: error: 'strncpy' was not declared in this scope
../include/charts.h:103:36: error: 'strcmp' was not declared in this scope
luli../include/uchart.h:187:33: error: 'memt' was not declared in this scope
../include/sock.h:58:9: error: an explicit specialization must be preceded by 'template <>'
aspek.cpp:100:18: error: 'strlen' was not declared in this scope
aspek.cpp:102:31: error: 'memcpy' was not declared in this scope
aspek.cpp:114:25: error: 'memcpy' was not declared in this scope
aspek.cpp:210:33: error: 'memt' was not declared in this scope
aspek.cpp:220:18: error: 'strlen' was not declared in this scope
aspek.cpp:222:31: error: 'memcpy' was not declared in this scope
自考毕业证查询aspek.cpp:232:23: error: 'strlen' was not declared in this scope
aspek.cpp:235:31: error: 'memcpy' was not declared in this scope
aspek.cpp:247:25: error: 'memcpy' was not declared in this scope
同样的错误省略不显⽰了
修正:
home/cyh/aspek/include/charts.h⽂件中的
26 #include <string.h>
错误:
templates.cpp:520:29: error: invalid conversion from 'const char*' to 'char*'
templates.cpp:527:23: error: invalid conversion from 'const void*' to 'void*'
templates.cpp:527:23: error: initializing argument 1 of 'void* memcpy(void*, const void*, size_t)' templates.cpp:528:11: error: assignment of read-only location '*(s + ((unsigned int)len))' templates.cpp:529:16: error: invalid conversion from 'const char*' to 'char*'
templates.cpp:529:16: error: initializing argument 1 of 'char* CTag::ParTag(char*)' templates.cpp:556:29: error: invalid conversion from 'const char*' to 'char*'
templates.cpp:1219:31: error: invalid conversion from 'const char*' to 'char*'
templates.cpp:1291:30: error: invalid conversion from 'const char*' to 'char*'
filters.cpp:48:31: error: invalid conversion from ‘const char*’ to ‘char*’
修正:
(1)templates.cpp⽂件中进⾏以下修改:
520 if (!(s =(char *) strchr(option,'>')))
rapetube1219 char* sp =(char *) strchr(psite, ' ');
1291 char* sp =(char *) strchr(px, ' ');
(2)/home/cyh/aspek/src/filters.cpp⽂件中进⾏以下修改:
48 char* pd =(char *) strrchr(param, '.');
错误:
/usr/include/stdlib.h:766:12: error: expected unqualified-id before ‘int’
/usr/include/stdlib.h:766:12: error: expected ‘)’ before ‘int’
/usr/include/stdlib.h:766:12: error: expected ‘)’ before ‘int’
/usr/include/c++/4.5/cstdlib:106:11: error: ‘::abs’ has not been declared
/
usr/include/c++/4.5/bits/stl_algo.h:3172:26: error: expected unqualified-id before ‘(’ token ../include/filters.h:81:28: error: ‘strdup’ was not declared in this scope
修正:
(1)/include/filters.h⽂件中进⾏以下修改:
28 #include <string.h>
(2)/home/cyh/aspek/include/ misc.h⽂件中进⾏以下修改:
58 #define MAX(a,b) ((a) > (b) ? (a) : (b))
60 #define MIN(a,b) ((a) < (b) ? (a) : (b))
62 #define ABS(a) ((a) >= 0 ? (a) : -(a))
centra错误:
aspek.cpp:1291: 41: error: 'min' was not declared in this scope
datasource.cpp:817:66: error: 'min' was not declared in this scope
filters.cpp:176:37: error: ‘min’ was not declared in this scope
filters.cpp:222:37: error: ‘min’ was not declared in this scope
come home
修正:
(1)aspek.cpp⽂件的1291⾏: res->last = MIN(nFirst, res->counts[2]);
(2)datasource.cpp⽂件的817⾏: int read = m_socket.Recv(buf, MIN(len, (int) (sizeof(buf) - 1)));其他同类错误的修改⽅法同上。
错误:
./include/resolve.h:121:42: error: ‘memt’ was not declared in this scope
修正:
./include/resolve.h⽂件中的26⾏: #include <string.h>
错误:
deltas.cpp:2407:47: error: ‘max’ was not declared in this scope
deltas.cpp:2451:40: error: ‘max’ was not declared in this scope
deltas.cpp: In member function ‘ULONG CBufferedFile::Read(void*, ULONG)’:
deltas.cpp:2595:18: error: lvalue required as left operand of assignment
deltas.cpp:2614:18: error: lvalue required as left operand of assignment
deltas.cpp:2650:18: error: lvalue required as left operand of assignment
deltas.cpp:2669:18: error: lvalue required as left operand of assignment
wcache.cpp:56:19: error: ‘min’ was not declared in this scope
wcache.cpp:790:32: error: ‘max’ was not declared in this scope
修正:
deltas.cpp⽂件中的2407⾏: WORD* times = new WORD[MAX(numUrl, maxUrl + 1)];lsp 什么意思
/home/cyh/aspek/src/deltas.cpp⽂件中的2595⾏: buf =(void *)((char *)buf+ rd);
其他同类错误修改⽅法同上。
错误:
../include/content.h:50:9: error: an explicit specialization must be preceded by ‘template <>’../include/stopwords.h:61:9: error: an explicit specialization must be preceded by ‘template <>’../include/rank.h:138:9: error: an explicit specialization must be preceded by ‘template <>’index.cpp:249:29: error: ‘min’ was not declared in this scope
修正:
../include/content.h⽂件中的50⾏: template<> struct hash<CLangString>
index.cpp⽂件中的249⾏: int c = MIN(prnk - rnk, 10);
其他同类错误修改⽅法同上。
错误:
misc.cpp:65:58: error: new declaration ‘char* strcastr(const char*, const char*)
修正:
misc.h⽂件中添加 #include<string.h>
注释misc.h中的41⾏: // char *strcastr(const char *haystack, const char *needle);
注释misc.cpp⽂件中65⾏: // char *strcastr(const char *haystack, const char *needle)
错误:
cctv9英语新闻mimeconv.cpp:64:26: error: ‘mkstemp’ was not declared in this scope
mimeconv.cpp:83:28: error: ‘mkstemp’ was not declared in this scope
mimeconv.cpp:103:21: error: ‘system’ was not declared in this scope
mimeconv.cpp:217:11: error: ‘exit’ was not declared in this scope
mimeconv.cpp:231:28: error: ‘system’ was not declared in this scope
mimeconv.cpp:231:29: error: ‘exit’ was not declared in this scope
修正:
在/home/cyh/aspek/include/ mimeconv.h⽂件中添加 #include <stdlib.h>
错误:
../include/affix.h:149:9: error: an explicit specialization must be preceded by ‘template <>’
../include/ccom.h:78:3: error: ‘IUnknown’ was not declared in this scope
../include/ccom.h:78:13: error: ‘pTemp’ was not declared in this scope
../include/ccom.h:142:11: error: ‘E_POINTER’ was not declared in this scope
../include/ccom.h:146:10: error: ‘S_OK’ was not declared in this scope
daemon.cpp:1370:38: error: invalid conversion from ‘const char*’ to ‘char*’
../include/ccom.h:103:3: error: ‘asrt’ was not declared in this scope
修正:
.
./include/affix.h⽂件中的149⾏: template<> struct hash<CSWord> {
错误:
../include/ccom.h:78: error: `IUnknown' was not declared in this scope
修正:
向ccom.h中复制以下代码:
滕王阁序翻译
#define S_OK 0
#define E_POINTER 0x80004003L
* IUnknown 接⼝ */
class IUnknown
{
public:
virtual unsigned int AddRef(void) = 0;
virtual unsigned int Relea(void) = 0;
virtual bool QueryInterface( const char* InterfaceName, void ** ppInterface ) = 0; };
错误:
streams.cpp:81:31: error: ‘min’ was not declared in this scope
arch.cpp:171:32: error: ‘max’ was not declared in this scope
arch.cpp:172:32: error: ‘min’ was not declared in this scope
arch.cpp:179:45: error: ‘min’ was not declared in this scope
arch.cpp:183:42: error: ‘max’ was not declared in this scope
arch.cpp:385:47: error: ‘min’ was not declared in this scope
arch.cpp:1378:46: error: ‘max’ was not declared in this scope
arch.cpp:2544:38: error: ‘max’ was not declared in this scope
arch.cpp:2545:50: error: ‘min’ was not declared in this scope
arch.cpp:2572:43: error: ‘max’ was not declared in this scope
arch.cpp:2573:53: error: ‘min’ was not declared in this scope
修正:
如梦令翻译arch.cpp⽂件中进⾏以下修正:
171 mins = MAX(minsite, m_minSite);
172 maxs = MIN(maxsite, m_maxSite);
错误: