Ive得到了这些错误消息:LNK2019错误C++解析外部符号
错误1个错误LNK2019:无法解析的 外部符号? “市民:无效 __thiscall ArrayIntStorage :: sortOwn(无效)” (sortOwn @ ArrayIntStorage @@ QAEXXZ) 在功能 引用_main G:\ 08227 \ ACW \ MAIN \ 08227_ACW2_Test_Harnesses_2010-11 \ C_Style_Array \ main.obj C_Style_Array
错误2错误LNK2019:无法解析 外部符号“公共:无效 __thiscall ArrayIntStorage :: sortStd(无效)” (sortStd @ @@ ArrayIntStorage QAEXXZ?) 在功能 引用_main G:\ 08227 \ ACW \ MAIN \ 08227_ACW2_Test_Harnesses_2010-11 \ C_Style_Array \ main.obj C_Style_Array
错误3错误LNK2019:未解析 外部符号 “类 的std :: basic_ostream> & __cdecl 操作者< <(类 的std :: basic_ostream> &,类 ArrayIntStorage常量&)” (?? 6 @ YAAAV $ basic_ostream @杜?$ @ char_traits @ d性病性病@@@ @@ AAV01 @ ABVArrayInt存储@@@ Z) 在功能 引用_main G:\ 08227 \ ACW \ MAIN \ 08227_ACW2_Test_Harnesses_2010-11 \ C_Style_Array \ main.obj C_Style_Array
错误4错误LNK2019:无法解析 外部符号“类 的std :: basic_istream> & __cdecl 操作>>(类 的std :: basic_istream> &,类 ArrayIntStorage &)” (?? 5 @ YAAAV?$ @ basic_istream杜?$ @ char_traits @ d性病性病@@@ @@ AAV01 @AAVArrayIntStorage @@@ Z) 在功能中引用 _main G:\ 08227 \ ACW \ MAIN \ 08227_ACW2_Test_Harnesses_2010-11 \ C_Style_Arra Y \ main.obj C_Style_Array
错误5错误LNK2019:无法解析的 外部符号 “市民:布尔 __thiscall ArrayIntStorage :: setReadSort(布尔)” (setReadSort @ ArrayIntStorage @@ QAE_N_N @ Z?) 在功能 引用_main G:\ 08227 \ ACW \ MAIN \ 08227_ACW2_Test_Harnesses_2010-11 \ C_Style_Array \ main.obj C_Style_Array
错误6错误LNK1120:5周悬而未决 的外部G:\ 08227 \ ACW \ MAIN \ 08227_ACW2_Test_Harnesses_2010-11 \ C_Style_Array \调试\ C_Style_Array.exe 1 1 C_Style_Array
我不知道发生了什么,我想知道是否错过了什么? 我是新来这和它不给我任何行号,以便林不知道给你那么它的代码我给你这部分
#include <fstream>
#include <iostream>
using namespace std;
#include "ArrayIntStorage.h"
int main(int argc, char **argv) {
ifstream fin1("ACW2_data.txt");
ofstream out1("1-arrayUnsortedRead.txt");
ofstream out2("2-arrayUnsortedRead-thenSTDSort.txt");
if(!fin1.is_open())
{
cout << "FAIL" << endl;
return 1;
}
ArrayIntStorage arrayStorage1;
arrayStorage1.setReadSort(false); // do not read sort
// read in int values into data structure
fin1 >> arrayStorage1;
// output int values in data structure to file
out1 << arrayStorage1;
// sort data structure using std
arrayStorage1.sortStd();
// output int values in data structure to file
out2 << arrayStorage1;
fin1.close();
out1.close();
out2.close();