我的程序编译,但我收到以下链接错误:
1>desalter.obj : error LNK2020: unresolved token (0A000065) "private: static double (* DataBace::Number_d_save)[110]" (?Number_d_save@DataBace@@$$Q0PAY0GO@NA)
1>desalter.obj : error LNK2020: unresolved token (0A000066) "private: static double (* DataBace::Flow_spec)[5]" (?Flow_spec@DataBace@@$$Q0PAY04NA)
1>desalter.obj : error LNK2020: unresolved token (0A000068) "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * DataBace::Flow_Name" (?Flow_Name@DataBace@@$$Q0PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>desalter.obj : error LNK2001: unresolved external symbol "private: static double (* DataBace::Flow_spec)[5]" (?Flow_spec@DataBace@@$$Q0PAY04NA)
1>desalter.obj : error LNK2001: unresolved external symbol "private: static double (* DataBace::Number_d_save)[110]" (?Number_d_save@DataBace@@$$Q0PAY0GO@NA)
1>desalter.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * DataBace::Flow_Name" (?Flow_Name@DataBace@@$$Q0PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>C:\Users\Mojtaba Mohayeji\Documents\Visual Studio 2010\Projects\desalter\Debug\desalter.exe : fatal error LNK1120: 6 unresolved externals
代码:
class DataBace
{
public:
//---
void fLOW_NAME(int indicator, string flow_name)
{
Flow_Name[indicator] = flow_name;
}
string** fLOW_NAME_READ()
{
string** flow_name_read = new string*[1];
for (int i = 1; i < 100; i++)
{
string a = Flow_Name[i];
flow_name_read[i] = &a;
}
return flow_name_read;
}
int Show(string show)
{
for (int i = 0; i < 100; i++)
{
string sh = Flow_Name[i];
if (sh==show)
{
return i;
}
}
}
void FLOW_SPEC(int indicator, double flow_spec[1][5])
{
for (int i = 0; i < 5; i++)
{
Flow_spec[indicator][i] = flow_spec[1][i];
}
}
double** FLOW_SPEC_READ(int SHOW)
{
double** flow_spec_read = new double*[5];
for (int i = 1; i < 5; i++)
{
double a = Flow_spec[SHOW][i];
flow_spec_read[i] = &a;
}
return flow_spec_read;
}
void Number_d_SAVE(int indicator, double Number_d[110])
{
for (int i = 0; i < 110; i++)
{
Number_d_save[indicator][i] = Number_d[i];
}
}
double** Number_d_READ(int SHOW)
{
double** Number_d_read = new double*[110];
for (int i = 1; i < 110; i++)
{
double a = Number_d_save[SHOW][i];
Number_d_read[i] = &a;
}
return Number_d_read;
}
private:
static string Flow_Name[100];
static double Flow_spec[100][5];
static double Number_d_save[100][110];
};