在工程头文件中引用头文件 #include <queue> 莫名奇妙出错,其原因很可能是由于头文件引用问题。
include/c++/4.7.1/bits/stl_vector.h:1308:40: error: expected unqualified-id before ‘(’ token
/lib/gcc/arm-linux-gnueabihf/4.7.1/../../../../arm-linux-gnueabihf/include/c++/4.7.1/vector:66:0,
from /lib/gcc/arm-linux-gnueabihf/4.7.1/../../../../arm-linux-gnueabihf/include/c++/4.7.1/queue:62,
from mediaserver/videosendsession.h:13,
from mediaserver/mediaserver.h:12,
from mediaserver/controlcenter.h:14,
from mediaserver/main.cpp:8:
/lib/gcc/arm-linux-gnueabihf/4.7.1/../../../../arm-linux-gnueabihf/include/c++/4.7.1/bits/stl_bvector.h: In member function ‘std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::_M_check_len(std::vector<bool, _Alloc>::size_type, const char*) const’:
/lib/gcc/arm-linux-gnueabihf/4.7.1/../../../../arm-linux-gnueabihf/include/c++/4.7.1/bits/stl_bvector.h:1051:45: error: expected unqualified-id before ‘(’ token
如上所示,一串吓死人的错误尝试在头文件引用前加入宏定义
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif