Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Link error when declaring public static variables in C
- #pragma once
- class Configuracion
- {
- public:
- static int MAX_ATAQUES;
- static int DIV_TERRITORIOS;
- };
- int Configuracion::MAX_ATAQUES = 5;
- int Configuracion::DIV_TERRITORIOS = 3;
- 1>JugadorIA.obj : error LNK2005: "public: static int Configuracion::MAX_ATAQUES"
- (?MAX_ATAQUES@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>JugadorIA.obj : error LNK2005: "public: static int Configuracion::DIV_TERRITORIOS"
- (?DIV_TERRITORIOS@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>Main.obj : error LNK2005: "public: static int Configuracion::MAX_ATAQUES"
- (?MAX_ATAQUES@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>Main.obj : error LNK2005: "public: static int Configuracion::DIV_TERRITORIOS"
- (?DIV_TERRITORIOS@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>PartidaClasica.obj : error LNK2005: "public: static int Configuracion::MAX_ATAQUES"
- (?MAX_ATAQUES@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>PartidaClasica.obj : error LNK2005: "public: static int Configuracion::DIV_TERRITORIOS"
- (?DIV_TERRITORIOS@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>PartidaMision.obj : error LNK2005: "public: static int Configuracion::MAX_ATAQUES"
- (?MAX_ATAQUES@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>PartidaMision.obj : error LNK2005: "public: static int Configuracion::DIV_TERRITORIOS"
- (?DIV_TERRITORIOS@Configuracion@@2HA) already defined in JugadorHumano.obj
- 1>D:LeireMy DropboxCarpetas compartidasCompartidos VictorPracticas POO IIP3P3M10DebugP3M10.exe : fatal error LNK1169: one or more multiply defined symbols found
- #include "Configuracion.h"
- int Configuracion::MAX_ATAQUES = 5;
- int Configuracion::DIV_TERRITORIOS = 3;
Add Comment
Please, Sign In to add comment