我得到一個奇怪的C3681錯誤,一直說不能找到我的一個函數的標識符。我非常困惑,並嘗試使用Google時找到的解決方案,但我無法解決問題。我寧願不使用stl。在C++中獲取構建錯誤
錯誤:
錯誤1個錯誤C3861: 'readTheStuff':標識符沒有發現C:\用戶\ XXXXXX \桌面\數據結構\ homework2 \ homework2 \ editor.cpp 38 1 Homework2
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int readFile(const char *fileName) {
ifstream myReadFile;
string line;
int i = 0;
myReadFile.open(fileName);
if (myReadFile.is_open()) {
while (!myReadFile.eof()) {
getline(myReadFile, line);
line += " "; //adds a space after every line
//cout << line << endl;
readTheStuff(line);
}
}
myReadFile.close();
return 0;
}
void readTheStuff(string command){
cout << command; //testing
}
int main(int argc, const char* argv[]){ //when they call, going to pass two parameters
if (argc > 2){
cout << "Error, more than one file given" << endl;
}
else if (argc < 2){
cout << "Error, no file given" << endl;
}
else if (argc == 2){
readFile(argv[1]);
}
}