title: VS c++ - error LNK2001: unresolved external symbol
body: <p>The error shown is: </p>
  
  <pre><code>error LNK2001: unresolved external symbol  "void __cdecl gerarPadroesTeste(double * const,double,int (* const)[31])" (?gerarPadroesTeste@@YAXQANNQAY0BP@H@Z)
  </code></pre>
  
  <p>My current header file:</p>
  
  <pre><code>#define K 16
  #define NR_PONTOS 9
  #define NR_REP_TOTAL 100000
  
  #define theta 0.50
  #define tau 16
  #define beta 6
  
  
  int unif();
  int somaMod2(int a, int b);
  double gaussiana(double m, double sd);
  double calcularPi(double zi, double variancia, bool computeBeta);
  
  void gerarResultados(double snrdb, double ber, double wer, int nerrb, int nerrw, char* s);
  
  void read_p();
  void generate_gf();
  void gen_poly();
  
  void encode_bch(int u[], int rd[]);
  void unirPalavraCodigo(int u[], int rd[], int c[]);
  void decode_bch(int y[]);
  void canalAWGN(double x[], double r[], double sd);
  void chase(double r[N], int y[N], double variancia, int z[K]);
  void gerarPadroesTeste(double r[N], double variancia, int pTeste[][N]);
  double distanciaEuclidiana(double r[], int y[]);
  
  void modularBPSK(int c[], double x[], double e);
  void demodularBPSK(double r[], int y[]);
  
  int pesoHamming(int a[]);
  bool isValid(int yt[]);
  
  double modulo(double n);
  </code></pre>
  
  <p>And my .cpp file has the implementation of all methods. I'll copy here the method that calls the failing method and the method itself:</p>
  
  <pre><code>void gerarPadroesTeste(int r[N], double variancia, int pTeste[][N])
  {
      double p[N];
      double aux;
  
      for (int a = 0; a &lt; N; a++){
          double mr = -modulo(r[a]);
          aux = calcularPi(mr, variancia, false);
          if (aux &lt;= 0.5 - theta)
              p[a] = 0;
          else if (aux &gt;= 0.5 + theta)
              p[a] = 1;
          else
              p[a] = calcularPi(mr, variancia, true);
      }
  
      for (int b = 0; b &lt; tau; b++){
          for (int c = 0; c &lt; N; c++){
              double k = rand();
              if (k/RAND_MAX &lt;= p[c])
                  pTeste[b][c] = 0;
              else
                  pTeste[b][c] = 1;
          }
      }
  }
  
  void chase(double r[N], int y[N], double variancia, int z[K])
  {
      int pTeste[tau][N];
      gerarPadroesTeste(r, variancia, pTeste);
  
      int i,j,m;
      int yt[N];
      int lambda[tau][N];
  
      for (i = 0; i &lt; tau; i++){
          for (j = 0; j &lt; N; j++){
              lambda[i][j] = -1;
          }
      }
  
      bool valido;
      for (i = 0; i &lt; tau; i++){
          for (j = 0; j &lt; N; j++){
              yt[j] = somaMod2(y[j],pTeste[i][j]);
          }
  
          decode_bch(yt);
  
          valido = isValid(yt);
  
          if (valido) {
              for (j = 0; j &lt; N; j++){
                  lambda[i][j] = yt[j];
              }
          }   
      }
  
      double minimo = 10000;
  
      for (i = 0; i &lt; tau; i++){
          if (lambda[i][0] == -1)
              continue;
          else{
              for (j = 0; j &lt; N; j++){
                  yt[j] = lambda[i][j];
              }
  
              if (distanciaEuclidiana(r,yt) &lt; minimo){
                  minimo = distanciaEuclidiana(r,yt);
                  for (m = 0; m &lt; K; m++){
                      z[m] = yt[m+length-K];
                  }
              }
          }
      }
  }
  </code></pre>