Can somebody help me with this? I'm using Visual Studio 2010 I'm getting this message and I don't know how to solve this.
1> Generating Code...
1>dct.obj : error LNK2019: unresolved external symbol "public: __thiscall Amostras::Amostras(class std::basic_string,class std::allocator >)" (??0Amostras@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
1>C:\Users\redneck\documents\visual studio 2010\Projects\dct\Debug\dct.exe : fatal error LNK1120: 1 unresolved externals
Here is some of the *.cpp file:
class Amostras {
public:
int original[10][257];
int idct[10][257];
float dct[10][257];
int grupos;
Amostras::Amostras(void)
{
for (int i=0;i<10;i++)
{
this->original[i][0]=0;
this->dct[i][0]=0.0;
this->idct[i][0]=0;
}
this->grupos=0;
}
Amostras::Amostras(string arquivo)
{
int n_samples=0,linha=0,coluna=0;
int cont;
..
and here is the *.h
class Amostras {
public:
int original[10][257];
int idct[10][257];
float dct[10][257];
int grupos;
Amostras::Amostras();
Amostras::Amostras(string arquivo);
void Amostras::mostra(void);
};
main
int main(void)
{
Amostras *amostra = new Amostras("in.txt");
dct(amostra,0);
show(amostra,0);
amostra->mostra();
return 0;
}
hope it helps, i'm running out of options here :(
Solution:
So what I did was just putting the class just in *.h and then including the *.h in the class *.cpp that only has the methods and functions of that class. It worked!