problème de compilation c++
salut tout le monde!
j'ai un probleme de compilation avec code::blocks que je ne sais résoudre .voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
//liste.h
#ifndef LISTE_H_INCLUDED
#define LISTE_H_INCLUDED
#include <cstdlib>
#include <iostream>
using namespace std;
class liste
{
int taille;
float *adr;
public:
liste(int);
~liste();
};
#endif // LISTE_H_INCLUDED |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| //liste.cpp
#include "liste.h"
using namespace std;
liste::liste(int ){
taille =n;
adr=new float[taille];
cout<<" Adresse de l'objet:"<<this;
cout<<" Adresse de liste:"<<adr<<"\n";
}
liste::~liste(){
cout<<"destruction de l'objet d'adresse "<<this;
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| //main.cpp
#include <cstdlib>
#include <iostream>
#include "liste.h"
using namespace std;
int main(int argc, char *argv[])
{
liste a(3);
system("PAUSE");
return 0;
} |
les erreurs de compilation sont:
Citation:
obj\Debug\main.o(.text+0x16f)||In function `main':
D:\CodeBlocks\listetp4\main.cpp|9|undefined reference to `liste::liste(int)'|
obj\Debug\main.o(.text+0x194): D:\CodeBlocks\listetp4\main.cpp|11|undefined reference to `liste::~liste()'|
obj\Debug\main.o(.text+0x1be): D:\CodeBlocks\listetp4\main.cpp|11|undefined reference to `liste::~liste()'|
||=== Build finished: 3 errors, 0 warnings ===|
que dois-je faire?merci d'avance!;)