在将一个X86的程序移植到arm时,有一个文件始终编译不通过,并报一大堆的STL错误,怀疑是编译器的问题
在X86下我用的编译器是3.2.2 arm-linux-gcc 版本2.95.3
下面是错误的节选
arm-linux-g++ a.cpp
/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../include/g++-3/stl_iterator.h: In function `void destroy<W *>(W *, W *)':
/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../include/g++-3/stl_iterator.h:154: template instantiation depth exceeds maximum of 17
/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../include/g++-3/stl_iterator.h:154: (use -ftemplate-depth-NN to increase the maximum)
a.cpp:165: instantiated from here
/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/../../../../include/g++-3/stl_construct.h:78: confused by earlier errors, bailing out
其中有一条是模板深度太深,也是写一测试程序
struct A
{
vector<int> a;
};
struct B
{
vector<A> b;
};
...
struct Z
{
vector<Z> z;
};
这个小程序也会报上面的错误,说明模板深度的问题由此引起,在我的正式程序中,可能函数嵌套调用导致此问题的发生
将此测试程序用arm-linux-gcc 3.3.2编译通过,证明了2.95.3不能支持
发表于 @ 2008年12月24日 14:55:00|评论(loading...)|收藏