Archived
This forum has been archived. Please start a new discussion on GitHub.
I can compile from ther client side but not the server
ferrazrafael
in Help Center
I'm using GCC 4.7.2 on Fedora 18 with IceGrid (Sorry for the long post, but I'm really stuck). And I can compile this code on the client side:
But on the server side I cant compile this:
I get this error from GCC on the catch
I'm really don't understand why this isn't compiling for the server side since its the basic same steps from the client side. I need that the server acts like a client getting information on another server called PlayerLocator that will store on which server every Player is connected on the grid.
The include files are the same for client and server. <Ice/Ice.h> and <IceGrid/IceGrid.h>
try
{
player = PlayerPrx::checkedCast(communicator()->stringToProxy("player"));
}
catch(const Ice::NotRegisteredException&)
{
IceGrid::QueryPrx query = IceGrid::QueryPrx::checkedCast(communicator()->stringToProxy("IceGrid/Query"));
player = PlayerPrx::checkedCast(query->findObjectByType("::NetworkICE::Player"));
}
if(!player)
{
cerr << argv[0] << ": couldn't find a `::NetworkICE::Player' object." << endl;
return EXIT_FAILURE;
}
But on the server side I cant compile this:
try
{
locator = PlayerLocatorPrx::checkedCast(communicator()->stringToProxy("PlayerLocator"));
}
catch(const Ice::NotRegisteredException&)
{
IceGrid::QueryPrx query = IceGrid::QueryPrx::checkedCast(communicator()->stringToProxy("IceGrid/Query"));
locator = PlayerLocatorPrx::checkedCast(query->findObjectByType("::NetworkICE::PlayerLocator"));
}
if(!locator)
{
cerr << argv[0] << ": couldn't find a `::NetworkICE::PlayerLocator' object." << endl;
return EXIT_FAILURE;
}
Ice::PropertiesPtr properties = communicator()->getProperties();
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("PlayerAdapter");
Ice::Identity id = communicator()->stringToIdentity(properties->getProperty("Identity"));
PlayerPtr player = new PlayerI();
adapter->add(player, id);
adapter->activate();
communicator()->waitForShutdown();
I get this error from GCC on the catch
main.cpp|| undefined reference to `IceProxy::IceGrid::Query::findObjectByType(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const*)'|
I'm really don't understand why this isn't compiling for the server side since its the basic same steps from the client side. I need that the server acts like a client getting information on another server called PlayerLocator that will store on which server every Player is connected on the grid.
The include files are the same for client and server. <Ice/Ice.h> and <IceGrid/IceGrid.h>
0
