Compilable avec Borland ?
Salut,
Dans un objectif d'apprentissage du C++, j'ai essayer le compiler le code écrit plus bas, avec Borland C++ 6.0, et aussi avec Visual C++ de Microsoft. Avec Visual, pas de problèmes. Parcontre, ça n'a pas été le cas avec Borland, qui affiche les messages d'erreurs suivants;
[Lieur Erreur] Unresolved external '__InitVCL' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\CP32MTI.LIB|crtlvcl
[Lieur Erreur] Unresolved external '__ExitVCL' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\CP32MTI.LIB|crtlvcl
SOS, quelqu'un a une idée pour réussir la compilation avec Borland ?
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 25 26 27 28 29
| #include <iostream>
using namespace std;
class test
{ public:
int num;
test (int); //declaration constructeur
~test(); //declaration destructeur
};
test::test (int n) //definition constructeur
{ num=n;
cout<<"++ Appel constructeur - num = "<<num<<endl;
}
test::~test() //definition destructeur
{ cout<<"-- Appel destructeur - num = "<<num<<endl;
}
void fct(int p)
{ test x(2*p);
}
main ()
{ void fct(int);
int i;
test a(1);
for (i=1;i<=2;i++)fct(i);
} |