又来求救了。g++编译问题````

为当前最终发行版之前的所有版本提供支持
回复
头像
lcdxiangzi
帖子: 164
注册时间: 2009-10-13 9:28
送出感谢: 0
接收感谢: 0

又来求救了。g++编译问题````

#1

帖子 lcdxiangzi » 2010-11-26 23:17

各位大侠,
原来在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’
头像
astolia
论坛版主
帖子: 3156
注册时间: 2008-09-18 13:11
送出感谢: 1 次
接收感谢: 528 次

Re: 又来求救了。g++编译问题````

#2

帖子 astolia » 2010-11-28 1:12

感觉是你代码的问题,检查一下first.h中81行的map有没有对应的声明。你不提供代码无法进一步分析
回复

回到 “老旧版本支持”