当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 用g++3.3编译成功,为何用g++4.3.2编译不成功?
帖子发表于 : 2008-11-10 17:15 

注册: 2008-11-10 17:04
帖子: 5
送出感谢: 0 次
接收感谢: 0 次
以前我用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


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 用g++3.3编译成功,为何用g++4.3.2编译不成功?
帖子发表于 : 2008-11-10 19:38 
头像

注册: 2008-03-23 0:39
帖子: 769
送出感谢: 0 次
接收感谢: 4
看下这个,虽然错误和你的不一样,不过也是编译器的兼容问题

http://bones7456.blog.ubuntu.org.cn/200 ... erence_to/


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 用g++3.3编译成功,为何用g++4.3.2编译不成功?
帖子发表于 : 2008-11-10 20:51 

注册: 2008-11-10 17:04
帖子: 5
送出感谢: 0 次
接收感谢: 0 次
在ubuntu上面下载了: Package: g++-3.3 (1:3.3.6-15ubuntu6) [universe]
和依赖包:
gcc-3.3 (= 1:3.3.6-15ubuntu6)
GNU C 語言編譯器

dep: gcc-3.3-base (= 1:3.3.6-15ubuntu6)
GNU 編譯器組合(基本套件)

dep: libc6 (>= 2.3)
GNU C 函式庫:共用函式庫
also a virtual package provided by libc6-udeb

dep: libstdc++5-3.3-dev (= 1:3.3.6-15ubuntu6)
The GNU Standard C++ Library v3 (development files)

sug: gcc-3.3-doc (>= 1:3.3.6-15ubuntu6)
Documentation for the GNU compilers (gcc, gobjc, g++)

重新安装了g++-3.3,问题解决了。

谢谢楼上的回答。


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译