मैं इस त्रुटि जब stl_vector.h
का उपयोग कर जी का उपयोग कर ++ संकलित करने के लिए हो रही है। लिनक्स पर मैं कर रहा हूँ।जी ++ उम्मीद अयोग्य-आईडी से पहले '(' टोकन
{
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
मैं सुनिश्चित नहीं हूं कि मैं क्यों 'm यह त्रुटि मिल रही है, मैं एक बहुत खोज की है और कुछ "समान" समस्या नहीं पाई, लेकिन मैं मेरा समाधान नहीं कर सकते
संपादित करें:।
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
: तो यहाँ त्रुटि लॉग है
आप पिछले त्रुटि लॉग है कि "वेक्टर" इस तरह हैडर "caction.h" से बुलाया जाता है में देख सकते हैं:
//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"
तो वेक्टर कॉल बिट्स इस तरह/stl_vector.h:
#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
वेक्टर (stl_vector और stl_bvector) से केवल अंतिम 2 शीर्षलेख मुझे एक ही त्रुटि देते हैं, बाकी ठीक हैं। कोई विचार?
आपकी मदद के लिए अग्रिम धन्यवाद।
क्या आपके पास '# परिभाषित अधिकतम' या ऐसा कुछ है? – user786653
बस अनुमान लगा रहा है, लेकिन कॉन्स्ट को हटाने का प्रयास करें। – Dabbler
क्या आप सीधे 'stl_vector.h'' या 'वेक्टर' हेडर –