sto ottenendo questo errore quando si utilizza stl_vector.h
. Sono su Linux usando g ++ per compilare.g ++ atteso non qualificato-id prima '(' token
{
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
Io non sono sicuro perché ho 'm ottenere questo errore, ho cercato un sacco e ha trovato alcuni problemi 'simili', ma non riesco a risolvere il mio
EDIT:. quindi ecco il log degli errori:
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
Si può vedere nel precedente log degli errori che "vettore" viene chiamato dal header "caction.h" come questo:
//THESE ARE THE INCLUDES IN "caction.h"
#ifndef CACTION_H
#define CACTION_H
#include <stdio.h>
#include <vector> //HERE IT CALLS <vector>
#include <list>
#include <map>
#include "cbaseobjects.h"
poi Vector chiama bit/stl_vector.h come questo:
#ifndef _GLIBCXX_VECTOR
#define _GLIBCXX_VECTOR 1
#pragma GCC system_header
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>//HERE IT CALLS stl_vector.h
#include <bits/stl_bvector.h> //Im actually getting the exact same error from stl_vector.h on this header
solo le ultime 2 intestazioni da vettore (stl_vector e stl_bvector) mi danno lo stesso identico errore, il resto è ok. Qualche idea?
Grazie in anticipo per il vostro aiuto.
Ti capita di avere un "#define max" o qualcosa del genere da qualche parte? – user786653
Solo a indovinare, ma prova a rimuovere il const. – Dabbler
Stai includendo 'stl_vector.h' direttamente o l'intestazione' vector' –