c语言令牌前不允许定义函数,c – g”’令牌之前预期的非限定id

使用stl_vector.h时出现此错误.我在

Linux上用g来编译.

{

if (max_size() - size() < __n)

__throw_length_error(__N(__s));

const size_type __len = size() + std::max(size(), __n); //THE ERROR IS ON THIS LINE!

return (__len < size() || __len > max_size()) ? max_size() : __len;

}

usr/include/c++/4.5/bits/stl_vector.h:1143:40: error: expected unqualified-id before ‘(’ token

我不知道为什么我会收到这个错误,我经常搜索并找到一些“相似”的问题,但我无法解决这个问题.

编辑:所以这是错误日志:

In file included from /usr/include/c++/4.5/vector:65:0,

from ../../RL_Toolbox/include/caction.h:34,

from ../../RL_Toolbox/include/cagent.h:35,

from shortestpathQLearning.cpp:42:

/usr/include/c++/4.5/bits/stl_vector.h:1143:40: error: expected unqualified-id before ‘(’ token

您可以在上一个错误日志中看到“vector”被标题“caction.h”调用,如下所示:

//THESE ARE THE INCLUDES IN "caction.h"

#ifndef CACTION_H

#define CACTION_H

#include

#include //HERE IT CALLS

#include

#include

#include "cbaseobjects.h"

然后Vector调用bits / stl_vector.h,如下所示:

#ifndef _GLIBCXX_VECTOR

#define _GLIBCXX_VECTOR 1

#pragma GCC system_header

#include

#include

#include

#include

#include //HERE IT CALLS stl_vector.h

#include //Im actually getting the exact same error from stl_vector.h on this header

只有来自vector的最后两个标题(stl_vector和stl_bvector)给出了完全相同的错误,其余的都没问题.有任何想法吗?

在此先感谢您的帮助.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值