用g++3.3编译成功,为何用g++4.3.2编译不成功?
发表于 : 2008-11-10 17:15
以前我用g++-3.3,编译通过,程序运行良好。后来安装了ubuntu后,g++升级成了g++-4.3.2.连编译都不通过了。
以下是错误提示,烦请高人指点,有什么解决方法。是不是要重新安装低版本的g++-3.3?
In file included from funktion.h:14,
from funktion.cc:1:
ga.h: In member function ‘bool Special<T>::SetInPara(unsigned int, unsigned int)’:
ga.h:170: error: there are no arguments to ‘memset’ that depend on a template parameter, so a declaration of ‘memset’ must be available
ga.h:170: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
ga.h: In member function ‘void BinGA<T, V>::DuplicateBest()’:
ga.h:300: error: ‘MidStruct’ was not declared in this scope
ga.h:301: error: ‘BestPopulation’ was not declared in this scope
ga.h:302: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::IniCHOAS()’:
ga.h:353: error: ‘InParaNo’ was not declared in this scope
ga.h:355: error: ‘ChoasChannel’ was not declared in this scope
ga.h:365: error: ‘InParaNo’ was not declared in this scope
ga.h:366: error: ‘ChoasChannel’ was not declared in this scope
ga.h: In member function ‘T BinGA<T, V>::CHOAS(int)’:
ga.h:372: error: ‘InParaNo’ was not declared in this scope
ga.h:373: error: ‘ChoasChannel’ was not declared in this scope
ga.h: In member function ‘T BinGA<T, V>::CHOAS()’:
ga.h:377: error: ‘ChoasChannel’ was not declared in this scope
ga.h:377: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Coding(T, T, V, int*)’:
ga.h:418: error: ‘MidStruct’ was not declared in this scope
ga.h:418: error: ‘Index4CodingProc’ was not declared in this scope
ga.h:425: error: ‘inStruct’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Coding(T*, T*, T*, unsigned int, int*)’:
ga.h:443: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::Random()’:
ga.h:454: error: ‘SpecialNo’ was not declared in this scope
ga.h:455: error: ‘InParaNo’ was not declared in this scope
ga.h:456: error: ‘MidStruct’ was not declared in this scope
ga.h:479: error: ‘SpecialNo’ was not declared in this scope
ga.h:480: error: ‘InParaNo’ was not declared in this scope
ga.h:485: error: ‘MidStruct’ was not declared in this scope
ga.h:491: error: ‘Index4CodingProc’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::Mutant()’:
ga.h:499: error: ‘InParaNo’ was not declared in this scope
ga.h:503: error: ‘MidStruct’ was not declared in this scope
ga.h:516: error: ‘SpecialNo’ was not declared in this scope
ga.h:517: error: ‘ShareMemPool’ was not declared in this scope
ga.h:518: error: ‘InParaNo’ was not declared in this scope
ga.h:519: error: ‘MidStruct’ was not declared in this scope
ga.h:558: error: ‘SpecialNo’ was not declared in this scope
ga.h:564: error: ‘InParaNo’ was not declared in this scope
ga.h:568: error: ‘MidStruct’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::GetBestResult(T*, int*)’:
ga.h:580: error: ‘SpecialNo’ was not declared in this scope
ga.h:581: error: ‘outResult’ was not declared in this scope
ga.h:581: error: ‘InParaNo’ was not declared in this scope
ga.h:586: error: ‘InParaNo’ was not declared in this scope
ga.h:587: error: ‘outResult’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::GetResult(T*, int*)’:
ga.h:595: error: ‘SpecialNo’ was not declared in this scope
ga.h:595: error: ‘InParaNo’ was not declared in this scope
ga.h:596: error: ‘outResult’ was not declared in this scope
ga.h: In member function ‘T* BinGA<T, V>::GetResult()’:
ga.h:600: error: ‘outResult’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::ReturnInPara(T*)’:
ga.h:604: error: ‘FittingArray’ was not declared in this scope
ga.h:604: error: ‘SpecialNo’ was not declared in this scope
ga.h:606: error: ‘MidStruct’ was not declared in this scope
ga.h:606: error: ‘inStruct’ was not declared in this scope
ga.h:606: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::SORT(T*)’:
ga.h:664: error: ‘SpecialNo’ was not declared in this scope
ga.h:665: error: ‘SortStruct’ was not declared in this scope
ga.h:668: error: ‘SortStruct’ was not declared in this scope
ga.h:668: error: ‘SpecialNo’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Crossover(int*)’:
ga.h:676: error: ‘FittingArray’ was not declared in this scope
ga.h:676: error: ‘SpecialNo’ was not declared in this scope
ga.h:684: error: ‘MidStruct’ was not declared in this scope
ga.h:684: error: ‘inStruct’ was not declared in this scope
ga.h:684: error: ‘InParaNo’ was not declared in this scope
ga.h:685: error: ‘outResult’ was not declared in this scope
ga.h:706: error: ‘outResult’ was not declared in this scope
ga.h:721: error: ‘ShareMemPool’ was not declared in this scope
ga.h:726: error: ‘SortStruct’ was not declared in this scope
ga.h:729: error: ‘InParaNo’ was not declared in this scope
ga.h:730: error: ‘BestPopulation’ was not declared in this scope
ga.h:730: error: ‘MidStruct’ was not declared in this scope
ga.h:739: error: ‘ShareMemPool’ was not declared in this scope
ga.h:744: error: ‘InParaNo’ was not declared in this scope
ga.h:745: error: ‘MidStruct’ was not declared in this scope
ga.h:773: error: ‘ShareMemPool’ was not declared in this scope
ga.h:778: error: ‘InParaNo’ was not declared in this scope
ga.h:779: error: ‘MidStruct’ was not declared in this scope
ga.h:804: error: ‘ShareMemPool’ was not declared in this scope
ga.h:809: error: ‘InParaNo’ was not declared in this scope
ga.h:810: error: ‘MidStruct’ was not declared in this scope
ga.h:827: error: ‘InParaNo’ was not declared in this scope
ga.h:828: error: ‘MidStruct’ was not declared in this scope
ga.h:828: error: ‘BestPopulation’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Selection(T*, unsigned int*, unsigned int, int)’:
ga.h:983: error: ‘SortStruct’ was not declared in this scope
ga.h:986: error: ‘SortStruct’ was not declared in this scope
ga.h:994: error: ‘SortStruct’ was not declared in this scope
ga.h:997: error: ‘SortStruct’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::FillTracerBuf(int*)’:
ga.h:1014: error: ‘FittingArray’ was not declared in this scope
ga.h:1014: error: ‘SpecialNo’ was not declared in this scope
ga.h:1016: error: ‘MidStruct’ was not declared in this scope
ga.h:1016: error: ‘inStruct’ was not declared in this scope
ga.h:1016: error: ‘InParaNo’ was not declared in this scope
make: *** [funktion.o] Error 1
以下是错误提示,烦请高人指点,有什么解决方法。是不是要重新安装低版本的g++-3.3?
In file included from funktion.h:14,
from funktion.cc:1:
ga.h: In member function ‘bool Special<T>::SetInPara(unsigned int, unsigned int)’:
ga.h:170: error: there are no arguments to ‘memset’ that depend on a template parameter, so a declaration of ‘memset’ must be available
ga.h:170: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
ga.h: In member function ‘void BinGA<T, V>::DuplicateBest()’:
ga.h:300: error: ‘MidStruct’ was not declared in this scope
ga.h:301: error: ‘BestPopulation’ was not declared in this scope
ga.h:302: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::IniCHOAS()’:
ga.h:353: error: ‘InParaNo’ was not declared in this scope
ga.h:355: error: ‘ChoasChannel’ was not declared in this scope
ga.h:365: error: ‘InParaNo’ was not declared in this scope
ga.h:366: error: ‘ChoasChannel’ was not declared in this scope
ga.h: In member function ‘T BinGA<T, V>::CHOAS(int)’:
ga.h:372: error: ‘InParaNo’ was not declared in this scope
ga.h:373: error: ‘ChoasChannel’ was not declared in this scope
ga.h: In member function ‘T BinGA<T, V>::CHOAS()’:
ga.h:377: error: ‘ChoasChannel’ was not declared in this scope
ga.h:377: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Coding(T, T, V, int*)’:
ga.h:418: error: ‘MidStruct’ was not declared in this scope
ga.h:418: error: ‘Index4CodingProc’ was not declared in this scope
ga.h:425: error: ‘inStruct’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Coding(T*, T*, T*, unsigned int, int*)’:
ga.h:443: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::Random()’:
ga.h:454: error: ‘SpecialNo’ was not declared in this scope
ga.h:455: error: ‘InParaNo’ was not declared in this scope
ga.h:456: error: ‘MidStruct’ was not declared in this scope
ga.h:479: error: ‘SpecialNo’ was not declared in this scope
ga.h:480: error: ‘InParaNo’ was not declared in this scope
ga.h:485: error: ‘MidStruct’ was not declared in this scope
ga.h:491: error: ‘Index4CodingProc’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::Mutant()’:
ga.h:499: error: ‘InParaNo’ was not declared in this scope
ga.h:503: error: ‘MidStruct’ was not declared in this scope
ga.h:516: error: ‘SpecialNo’ was not declared in this scope
ga.h:517: error: ‘ShareMemPool’ was not declared in this scope
ga.h:518: error: ‘InParaNo’ was not declared in this scope
ga.h:519: error: ‘MidStruct’ was not declared in this scope
ga.h:558: error: ‘SpecialNo’ was not declared in this scope
ga.h:564: error: ‘InParaNo’ was not declared in this scope
ga.h:568: error: ‘MidStruct’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::GetBestResult(T*, int*)’:
ga.h:580: error: ‘SpecialNo’ was not declared in this scope
ga.h:581: error: ‘outResult’ was not declared in this scope
ga.h:581: error: ‘InParaNo’ was not declared in this scope
ga.h:586: error: ‘InParaNo’ was not declared in this scope
ga.h:587: error: ‘outResult’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::GetResult(T*, int*)’:
ga.h:595: error: ‘SpecialNo’ was not declared in this scope
ga.h:595: error: ‘InParaNo’ was not declared in this scope
ga.h:596: error: ‘outResult’ was not declared in this scope
ga.h: In member function ‘T* BinGA<T, V>::GetResult()’:
ga.h:600: error: ‘outResult’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::ReturnInPara(T*)’:
ga.h:604: error: ‘FittingArray’ was not declared in this scope
ga.h:604: error: ‘SpecialNo’ was not declared in this scope
ga.h:606: error: ‘MidStruct’ was not declared in this scope
ga.h:606: error: ‘inStruct’ was not declared in this scope
ga.h:606: error: ‘InParaNo’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::SORT(T*)’:
ga.h:664: error: ‘SpecialNo’ was not declared in this scope
ga.h:665: error: ‘SortStruct’ was not declared in this scope
ga.h:668: error: ‘SortStruct’ was not declared in this scope
ga.h:668: error: ‘SpecialNo’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Crossover(int*)’:
ga.h:676: error: ‘FittingArray’ was not declared in this scope
ga.h:676: error: ‘SpecialNo’ was not declared in this scope
ga.h:684: error: ‘MidStruct’ was not declared in this scope
ga.h:684: error: ‘inStruct’ was not declared in this scope
ga.h:684: error: ‘InParaNo’ was not declared in this scope
ga.h:685: error: ‘outResult’ was not declared in this scope
ga.h:706: error: ‘outResult’ was not declared in this scope
ga.h:721: error: ‘ShareMemPool’ was not declared in this scope
ga.h:726: error: ‘SortStruct’ was not declared in this scope
ga.h:729: error: ‘InParaNo’ was not declared in this scope
ga.h:730: error: ‘BestPopulation’ was not declared in this scope
ga.h:730: error: ‘MidStruct’ was not declared in this scope
ga.h:739: error: ‘ShareMemPool’ was not declared in this scope
ga.h:744: error: ‘InParaNo’ was not declared in this scope
ga.h:745: error: ‘MidStruct’ was not declared in this scope
ga.h:773: error: ‘ShareMemPool’ was not declared in this scope
ga.h:778: error: ‘InParaNo’ was not declared in this scope
ga.h:779: error: ‘MidStruct’ was not declared in this scope
ga.h:804: error: ‘ShareMemPool’ was not declared in this scope
ga.h:809: error: ‘InParaNo’ was not declared in this scope
ga.h:810: error: ‘MidStruct’ was not declared in this scope
ga.h:827: error: ‘InParaNo’ was not declared in this scope
ga.h:828: error: ‘MidStruct’ was not declared in this scope
ga.h:828: error: ‘BestPopulation’ was not declared in this scope
ga.h: In member function ‘bool BinGA<T, V>::Selection(T*, unsigned int*, unsigned int, int)’:
ga.h:983: error: ‘SortStruct’ was not declared in this scope
ga.h:986: error: ‘SortStruct’ was not declared in this scope
ga.h:994: error: ‘SortStruct’ was not declared in this scope
ga.h:997: error: ‘SortStruct’ was not declared in this scope
ga.h: In member function ‘void BinGA<T, V>::FillTracerBuf(int*)’:
ga.h:1014: error: ‘FittingArray’ was not declared in this scope
ga.h:1014: error: ‘SpecialNo’ was not declared in this scope
ga.h:1016: error: ‘MidStruct’ was not declared in this scope
ga.h:1016: error: ‘inStruct’ was not declared in this scope
ga.h:1016: error: ‘InParaNo’ was not declared in this scope
make: *** [funktion.o] Error 1