Hola a todos aquí sigo sufriendo con Ice.
Después de superar la etapa de IceGrid ahora tocaba utilizar freeze map.
Os cuento como he intentado solucionar mi problema original
intentándolo probar con un ejemplo sencillo:
En un server tenía:
struct Server: public Application {
int run(int argc, char* argv[]) {
shutdownOnInterrupt();
Freeze::ConnectionPtr connection =
Freeze::createConnection(communicator(), "db");
...
...
...
...
communicator()->waitForShutdown();
return 0;
}
};
Y para poder utilizar freeze map utilizaba los siguientes pasos:
añadir en el makefile la siguiente línea:
LDLIBS= -lFreeze
Ahora en línea de comandos poner:
$ slice2freeze --dict StringIntMap,string,int StringIntMap
Se crea un contenedor denominado StringIntMap con un tipo de
clave string y un valor
int. El último argumento hace referencia al nombre de los archivos de
salida, que en este caso
son StringIntMap.h y StringIntMap.cpp.
Le doy a Intro y .... Bien! funciona.
Ahora añado estas líneas al archivo server.cpp:
#include <StringIntMap.h>
#include <Freeze/Freeze.h>
hago en línea de comandos:
$make
y bien funciona.
EL PROBLEMA VIENE CUANDO EN SERVER.CPP añado la siguiente línea:
struct Server: public Application {
int run(int argc, char* argv[]) {
shutdownOnInterrupt();
Freeze::ConnectionPtr connection =
Freeze::createConnection(communicator(), "db");
StringIntMap map(connection, "simple"); <----- ESTA ES LA QUE
PROVOCA QUE MI PROGRAMA HAGA PUTUFF
Ahora en línea de comandos pongo:
$make
y me saca el siguiente jeroglífico:
In function `Freeze::Map<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int,
StringIntMapKeyCodec, StringIntMapValueCodec,
Freeze::IceEncodingCompare>::Map(IceInternal::Handle<Freeze::Connection>
const&, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, bool, Freeze::IceEncodingCompare
const&)':
Server2.cc:(.text._ZN6Freeze3MapISsi20StringIntMapKeyCodec22StringIntMapValueCodecNS_18IceEncodingCompareEEC1ERKN11IceInternal6HandleINS_10ConnectionEEERKSsbRKS3_[Freeze::Map<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int,
StringIntMapKeyCodec, StringIntMapValueCodec,
Freeze::IceEncodingCompare>::Map(IceInternal::Handle<Freeze::Connection>
const&, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, bool, Freeze::IceEncodingCompare
const&)]+0xb3): undefined reference to
`StringIntMapValueCodec::typeId()'
Server2.cc:(.text._ZN6Freeze3MapISsi20StringIntMapKeyCodec22StringIntMapValueCodecNS_18IceEncodingCompareEEC1ERKN11IceInternal6HandleINS_10ConnectionEEERKSsbRKS3_[Freeze::Map<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int,
StringIntMapKeyCodec, StringIntMapValueCodec,
Freeze::IceEncodingCompare>::Map(IceInternal::Handle<Freeze::Connection>
const&, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, bool, Freeze::IceEncodingCompare
const&)]+0xd6): undefined reference to
`StringIntMapKeyCodec::typeId()'
collect2: ld devolvió el estado de salida 1
make: *** [Server2] Error 1
... Después de ver lo anterior. ¿Alguien me puede ayudar?
Nota: también lo he probado así:
struct Server: public Application {
int run(int argc, char* argv[]) {
shutdownOnInterrupt();
ObjectAdapterPtr oa =
communicator()->createObjectAdapter("Vendedor");
ObjectPrx prx = oa->add(new
Vendedor(),communicator()->stringToIdentity("Vende"));
Freeze::ConnectionPtr connection =
Freeze::createConnection(communicator(), "db");
StringIntMap map(connection, "simple");
Saludos.
*****************************************************************
La ciencia es algo más que un conjunto de técnicas, conocimientos,
teoremas, pruebas ..., es una manera de pensar.
Si a las asignaturas de Literatura en la ESI.
_______________________________________________
CRySoL mailing list
http://crysol.inf-cr.uclm.es/
https://arco.inf-cr.uclm.es/cgi-bin/mailman/listinfo/crysol