SoloCodigo

Programación General => C/C++ => Visual C++ => Mensaje iniciado por: pix en Martes 27 de Mayo de 2008, 13:38

Título: Errores Al Hacer Build
Publicado por: pix en Martes 27 de Mayo de 2008, 13:38
Hola, al hacer "Build" en mi proyecto me salen los siguientes errores:

1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Ident::~Ident(void)" (??1Ident@@QAE@XZ) referenced in function _main
1>D:\Programación C++\ident_estat\Debug\ident_estat.exe : fatal error LNK1120: 1 unresolved externals

ESTOS SON LOS 3 ARCHIVOS QUE TENGO EN MI PROYECTO:

MAIN.CPP
#include <stdio.h>
#include <stdlib.h>
#include "ident.h"
#include <time.h>
#pragma once
//#include "stdafx.h"
#pragma warning(disable : 4996)


void main()
{
   FILE *fichero1;
   FILE *fichero2;
   Ident one;
   


   fichero1 = fopen("secuencia_ceros.txt","r");
   if(fichero1 == NULL)
   {
      printf("Ha habido un error al acceder al fichero\n");
      exit(-1);
   }
   fichero2 = fopen("secuencia_unos.txt","r");
   if(fichero2 == NULL)
   {
      printf("Ha habido un error al acceder al fichero\n");
      exit(-1);
   }

   

   printf("Ficheros abiertos\n");
   one.leersecuencia(fichero1,fichero2);
   printf("Secuencias obtenidas\n");

IDENT.CPP
#include "Ident.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#pragma once

Ident::Ident(void)
{


}


                  
void Ident::leersecuencia(FILE *fin,FILE *fout)


IDENT.H
#pragma once
#include <stdio.h>

#ifndef __IDENT__
#define __IDENT__
#define N 129   
#define M 14


class Ident
{
private:
   
   int *mat[N][M];

public:

   Ident(void);
   void leersecuencia(FILE *fin,FILE *fout);   //almacena las secuencias de entrada y salida en matriz
   ~Ident(void);
};
#endif

No sé cómo resolverlo. ¿me podeis ayudar?
muchas gracias
Título: Re: Errores Al Hacer Build
Publicado por: Eternal Idol en Martes 27 de Mayo de 2008, 14:21
Hay un solo error:
main.obj : error LNK2019: unresolved external symbol "public: __thiscall Ident::~Ident(void)" (??1Ident@@QAE@XZ) referenced in function _main

El enlazador no puede encontrar un simbolo, en este caso el del destructor de la clase Ident. Implementa ese destructor ... hasta ahora solo lo tenes declarado en  IDENT.H: ~Ident(void);

Hace lo mismo que hiciste para el constructor.
Título: Re: Errores Al Hacer Build
Publicado por: pix en Martes 27 de Mayo de 2008, 14:28
Ya lo he solucionado!