visual c++: error LNK2019 et fatal error LNK1120
Bonjour,
je debute avec visual c++. J'ai fait un petit programme dont voici le code source:
fichier: vecteur.hpp
/**********************************/
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| #ifndef __VECTEUR_HPP__
#define __VECTEUR_HPP__
class Vecteur {
protected:
int taille;
int* tab;
static int nbVect;
static void incNbVect();
public:
static int getNbVect();
};
#endif |
/**********************************/
Fichier: vecteur.cpp
/**********************************/
Code:
1 2 3 4 5 6 7 8 9 10 11
| #include <iostream>
#include <cstdlib>
#include "Vecteur.hpp"
using namespace std;
int Vecteur::nbVect=0;
void Vecteur::incNbVect(){
nbVect++;
}
int main(void){
} |
/**********************************/
Cependant, après compilation, j'ai l'erreur suivante:
Compiling...
Vecteur.cpp
Linking...
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
Debug\proj.exe : fatal error LNK1120: 1 unresolved externals
pouvez vous m'aider à corriger cette erreur svp?
Merci d'avance.