安卓-NDK-R7C "deque.h"中的非限定 ID 错误

android-ndk-r7c unqualified-id error in "deque.h"

本文关键字:ID 错误 -NDK-R7C deque 安卓      更新时间:2023-10-16

我正在使用ndk r7c将一些Windows C++移植到ANSI,以便在Android 4.0.3上使用。

原始代码设置一个 UDP 客户端和一个数据包队列,它按设定的时间间隔检查,以便在程序在其他地方繁忙时队列填满,因此主程序不会占用轮询传入的数据包。代码相当长,所以我不会在这里发布它。

我不断收到消息:

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

我以前在编码时见过非限定 id 消息,但从未找到导致它的明确答案。我尝试在Tcan.h的不同地方重新排列我的包含,没有帮助。Tcan.h:5是我#include <queue>的地方。在 ndk 中是否有错误或遗漏了什么来弄乱队列?或者有谁知道这个错误的可能原因?

谢谢

编辑:使用ndk-r7b没有区别。我不认为会,但我想无论如何我都会检查。

max可能是尚未

声明的宏的问题:在此处检查第一篇文章(它大约是 3-arg 最大值,但问题似乎是一样的)。作为修复,您还可以尝试从 max 中删除 std:: 前缀,如此处的第一篇文章所示。