Voilà comment déclarer ma classe:
	
	1 2 3 4 5 6 7 8 9 10
   | classe A
{
private:
           x,y,z;
public:
           A();
          ~A();
          void m1(const std::string x1, const std::string y1);
 },
A a; | 
 Et j'ai deux fichiers source, j'ai met dans l'un des fichiers l'implémentation de méthode et dans  l'autre l'appel de méthode
	
	a.m1("fichier1.txt","fichier2.txt");
 Finalement j'ai inclut mon fichier .h dans les deux sources,
et voilà la liste d'erreurs:
	
	1 2 3 4
   | 1>error LNK2005: "class A a" (?a@@3VA@@A) already defined in main.obj
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall A::A(void)" (??0A@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'a''(void)" (??__EA@@YAXXZ)
1>error LNK2001: unresolved external symbol "public: __thiscall A::A(void)" (??0A@@QAE@XZ)
1>fatal error LNK1120: 1 unresolved externals  | 
 
						
					
Partager