Note that there are some explanatory texts on larger screens.

plurals
  1. POLNK2019: unresolved external symbol but I have coded the function
    primarykey
    data
    text
    <p>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.</p> <blockquote> <p>1> Generating Code...</p> <p>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</p> <p>1>C:\Users\redneck\documents\visual studio 2010\Projects\dct\Debug\dct.exe : fatal error LNK1120: 1 unresolved externals</p> </blockquote> <p>Here is some of the *.cpp file:</p> <pre><code>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&lt;10;i++) { this-&gt;original[i][0]=0; this-&gt;dct[i][0]=0.0; this-&gt;idct[i][0]=0; } this-&gt;grupos=0; } Amostras::Amostras(string arquivo) { int n_samples=0,linha=0,coluna=0; int cont; .. </code></pre> <p>and here is the *.h</p> <pre><code>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); }; </code></pre> <p>main</p> <pre><code>int main(void) { Amostras *amostra = new Amostras("in.txt"); dct(amostra,0); show(amostra,0); amostra-&gt;mostra(); return 0; } </code></pre> <p>hope it helps, i'm running out of options here :(</p> <hr> <p>Solution:</p> <p>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!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload