小编use*_*480的帖子

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;
}
Run Code Online (Sandbox Code Playgroud)

usr/include/c ++/4.5/bits/stl_vector.h:1143:40:错误:‘(’令牌之前的预期unqualified-id

我不知道为什么我会收到这个错误,我搜索了很多,发现了一些"相似"的问题,但我无法解决这个问题.

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

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
Run Code Online (Sandbox Code Playgroud)

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

//THESE ARE THE INCLUDES IN "caction.h"
#ifndef CACTION_H
#define CACTION_H
#include <stdio.h> 
#include <vector> //HERE IT …
Run Code Online (Sandbox Code Playgroud)

c++ g++

8
推荐指数
2
解决办法
9900
查看次数

标签 统计

c++ ×1

g++ ×1