Implicit instantiation of undefined template 'std::basic_ifstream<char,std::char_traits<char>>'
मुझे यह ifstream त्रुटि क्यों मिल रही है?
#ifndef MAPPER_H
#define MAPPER_H
#include <iostream>
#include <string>
#include <vector>
#include "KeyValue.h"
#include "Parser.h"
using namespace std;
class Mapper
{
public:
Mapper(ifstream& infile);
~Mapper(void);
void loadTokens();
void showTokens();
void map();
void printMap();
void printMap(string map_fileName);
private:
ifstream inFile; //<-- is where the error is happening
vector<string> tokens;
vector<KeyValue> map_output;
Parser* parser;
};
#endif
मैं भी std::ifstream
डालने की कोशिश की है और यह अभी भी काम नहीं करता।
जब मैं #include <iostream>
बजाय #include <fstream>
, मैं fstream.tcc
और basic_ios.tcc
में इन त्रुटियों को मिलता है:
'operator=' is a private member of 'std::basic_streambuf<char>'
और चूंकि कि fstream पुस्तकालय का हिस्सा है, स्पष्ट रूप से कुछ मैं कर रहा हूँ गलत है ...
कोई भी मदद करने में सक्षम है?
आपके पास '' '' 'ऑपरेटर =' वास्तविक त्रुटि है। आउटपुट विंडो में उस त्रुटि संदेश का शेष होना चाहिए, जिसमें लाइन नंबर भी शामिल है जहां आप 'मैपर' ऑब्जेक्ट की एक प्रति बनाते हैं। –
आपको उस कोड को दिखाने की ज़रूरत है जो दूसरी त्रुटि का कारण बनती है। –