“deque.h”中的android-ndk-r7c不合格id错误

时间:2022-03-28 01:51:11

I'm porting some Windows C++ to ANSI to be used on Android 4.0.3, using ndk r7c.

我将一些Windows c++移植到ANSI上,在Android 4.0.3中使用ndk r7c。

The original code sets up a UDP client and a packet queue that it checks at set intervals, so that the queue fills up while the program is busy elsewhere, so the main program isn't tied up polling the incoming packets. The code is fairly long, so I won't post it here yet.

原始代码设置了一个UDP客户机和一个数据包队列,并在设置的间隔内检查它们,这样当程序在其他地方忙的时候,队列就会被填满,这样主程序就不会阻塞轮询传入的数据包。代码很长,所以我不会在这里发布。

I keep getting the message:

我不断得到信息:

In file included from C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/deque:65,
                 from C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/queue:61,
                 from jni/Tcan.h:5,
                 from jni/caneth_wrap.cpp:215:
C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_deque.h: In member function 'void std::_Deque_base<_Tp, _Alloc>::_M_initialize_map(size_t)':
C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_deque.h:498: error: expected unqualified-id before '(' token
In file included from C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/deque:68,
                 from C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/queue:61,
                 from jni/Tcan.h:5,
                 from jni/caneth_wrap.cpp:215:
C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/deque.tcc: In member function 'void std::deque<_Tp, _Alloc>::_M_reallocate_map(size_t, bool)':
C:/Android/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/deque.tcc:820: error: expected unqualified-id before '(' token

I've seen the unqualified-id message when coding before, but never found a definitive answer for what causes it. I have tried rearranging my includes in different places in Tcan.h, no help. Tcan.h:5 is where I have #include <queue>. Is there a bug or something I've missed in ndk that messes with queue? Or does anyone know of possible causes of this error in deque?

我以前在编写代码时看到过不限定id消息,但从来没有找到导致它的确切答案。我试过在Tcan的不同地方重新排列我的包。h,没有帮助。Tcan。h:5是#include 的位置。在ndk中是否有一个bug或者是我漏掉了什么使队列混乱的东西?或者有人知道deque可能的原因吗?

Thanks

谢谢

EDIT: Using ndk-r7b makes no difference. I didn't think it would, but thought I'd check anyway.

编辑:使用ndk-r7b没有区别。我不认为会这样,但我想我还是要检查一下。

1 个解决方案

#1


1  

Might be a problem with max being a macro which has not been declared: check the first post here (it's about a 3-arg max, but the problem seems to be the same). As a fix, you can also try removing the std:: prefix from max, as in the first post here.

max可能是一个尚未声明的宏的问题:查看这里的第一个post(它大约是一个3-arg的最大值,但是问题似乎是一样的)。作为修复,您也可以尝试删除std::从max的前缀,就像在这里的第一个帖子一样。

#1


1  

Might be a problem with max being a macro which has not been declared: check the first post here (it's about a 3-arg max, but the problem seems to be the same). As a fix, you can also try removing the std:: prefix from max, as in the first post here.

max可能是一个尚未声明的宏的问题:查看这里的第一个post(它大约是一个3-arg的最大值,但是问题似乎是一样的)。作为修复,您也可以尝试删除std::从max的前缀,就像在这里的第一个帖子一样。