:O Gracias! parece haberse solucionado!
fue menos lio de lo q pense xd gracias denuevo.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menúgame.cpp: In static member function 'static std::string Game::MenssageArrival(unsigned int, std::string)':
game.cpp:48: error: cannot call member function 'void Game::SetDefaultValues()' without object
Game.hpp:21: error: invalid use of member 'Game::uInt_StateGame' in static member function
game.cpp:49: error: from this location
#include<iostream>
using namespace std;
class ServerDosGame
{
public:
string (*fMsg)(unsigned int uInt_ID, string Str_Msg);
ServerDosGame( unsigned int & NumberOfPlayers, unsigned int & uInt_StateGame, string (*FuncOfMsg)(unsigned int uInt_ID, string Str_Msg) )
{
fMsg = FuncOfMsg;
}
};
class Game
{
public:
unsigned int uInt_NumberOfPlayers, uInt_StateGame;
ServerDosGame *Server;
string MenssageArrival(unsigned int uInt_ID, string Str_Msg)
{
string retorno;
return retorno;
}
int run()
{
Server = new ServerDosGame(uInt_NumberOfPlayers, uInt_StateGame, MenssageArrival);
return 1;
}
};
int main( int argc, char **argv )
{
Game *game = new Game();
return game->run();
}
g++ *.cpp
main.cpp: In member function 'int Game::run()':
main.cpp:33: error: no matching function for call to 'ServerDosGame::ServerDosGame(unsigned int&, unsigned int&, <unresolved overloaded function type>)'
main.cpp:11: note: candidates are: ServerDosGame::ServerDosGame(unsigned int&, unsigned int&, std::string (*)(unsigned int, std::string))
main.cpp:7: note: ServerDosGame::ServerDosGame(const ServerDosGame&)
string (FuncOfMsg)(unsigned int uInt_ID, string Str_Msg)
por string (*FuncOfMsg)(unsigned int uInt_ID, string Str_Msg)
string (* SendMsg )(unsigned int uInt_ID, string Str_Msg);
SendMsg = MenssageArrival;
Server = new ServerDosGame(uInt_NumberOfPlayers, uInt_StateGame, SendMsg);
ServerDosGame(unsigned int & NumberOfPlayers, unsigned int & uInt_StateGame, string (*FuncOfMsg)(unsigned int uInt_ID, string Str_Msg) );
game.cpp:17: error: argument of type 'std::string (Game::)(unsigned int, std::string)' does not match 'std::string (*)(unsigned int, std::string)'
game.cpp: In member function 'int Game::Start()':
game.cpp:14: error: no matching function for call to 'ServerDosGame::ServerDosGame(unsigned int&, unsigned int&, <unresolved overloaded function type>)'
DGS.hpp:24: note: candidates are: ServerDosGame::ServerDosGame(unsigned int&, unsigned int&, std::string (*)(unsigned int, std::string))
DGS.hpp:21: note: ServerDosGame::ServerDosGame(const ServerDosGame&)
Server = new ServerDosGame(uInt_NumberOfPlayers, uInt_StateGame, MenssageArrival);
string MenssageArrival(unsigned int uInt_ID, string Str_Msg);
ServerDosGame(unsigned int & NumberOfPlayers, unsigned int & uInt_StateGame, string (FuncOfMsg)(unsigned int uInt_ID, string Str_Msg) );