各位大侠,
原来在910写好的代码。
在原来的910系统上是可以相互搬的,整个文件夹直接替换。编译是没有问题的。
现在换成了1010的系统。
原样搬过来,编译通不过,错误如下,编译结果:
编译命令: g++ -o first $(pkg-config --cflags --libs playerc++ gtk+-2.0 gthread-2.0) first.cc -I ./l
求解决方案!!!
xxxxx@xxx:~/lab/Stage-3.2.2-Source/worlds$ g++ -o first $(pkg-config --cflags --libs playerc++ gtk+-2.0 gthread-2.0) first.cc -I ./l
In file included from first.cc:1:
first.h:81: error: reference to ‘map’ is ambiguous
first.h:62: error: candidates are: struct map
/usr/include/c++/4.4/bits/stl_map.h:86: error: template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map
first.h:81: error: expected constructor, destructor, or type conversion before ‘*’ token
first.h:82: error: reference to ‘map’ is ambiguous
first.h:62: error: candidates are: struct map
/usr/include/c++/4.4/bits/stl_map.h:86: error: template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map
first.h:82: error: expected constructor, destructor, or type conversion before ‘*’ token
first.h:112: error: reference to ‘map’ is ambiguous
first.h:62: error: candidates are: struct map
/usr/include/c++/4.4/bits/stl_map.h:86: error: template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map
first.h:112: error: variable or field ‘InsertLine’ declared void
first.h:112: error: reference to ‘map’ is ambiguous
first.h:62: error: candidates are: struct map
/usr/include/c++/4.4/bits/stl_map.h:86: error: template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map
first.h:112: error: ‘rtmap’ was not declared in this scope
first.h:112: error: expected primary-expression before ‘double’
first.h:112: error: expected primary-expression before ‘double’
first.h:112: error: expected primary-expression before ‘int’
first.cc: In function ‘void InitLine()’:
first.cc:17: error: ‘rt1map’ was not declared in this scope
first.cc:17: error: reference to ‘map’ is ambiguous
first.h:62: error: candidates are: struct map
/usr/include/c++/4.4/bits/stl_map.h:86: error: template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map
first.cc:17: error: expected type-specifier before ‘map’
first.cc:17: error: expected ‘;’ before ‘map’
first.cc:19: error: ‘rt2map’ was not declared in this scope
first.cc:19: error: reference to ‘map’ is ambiguous
first.h:62: error: candidates are: struct map
/usr/include/c++/4.4/bits/stl_map.h:86: error: template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map
first.cc:19: error: expected type-specifier before ‘map’
first.cc:19: error: expected ‘;’ before ‘map’
又来求救了。g++编译问题````
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
- lcdxiangzi
- 帖子: 164
- 注册时间: 2009-10-13 9:28
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: 又来求救了。g++编译问题````
感觉是你代码的问题,检查一下first.h中81行的map有没有对应的声明。你不提供代码无法进一步分析