Home Help Center

Ice client coredump on VC6.0

richardmarichardma Member richardOrganization: qqProject: wap ✭✭
the definition as follows in interface:
module Demo
{
sequence<string> StrSeq;
class cApp
{
StrSeq sGsm;
};

interface Hello
{
nonmutating void sayHello(out cApp obj);
};

};

and the server implement in the HelloI.cpp( C++ on Linux)
void
HelloI::sayHello(cAppPtr& obj, const Ice::Current&) const
{
obj = new cApp;
obj->sGsm.push_back("123456789");
cout << "Hello World!" << endl;
}

the client implement in the Client.cpp(Vc6.0)
try
{
communicator = Ice::initialize(argc, argv);
HelloPrx hello = HelloPrx::checkedCast(communicator->stringToProxy("hello:tcp -p 10000"));
if(!hello)
{
cerr << argv[0] << ": invalid proxy" << endl;
status = EXIT_FAILURE;
}
else
{
cAppPtr obj;
hello->sayHello(obj);
for( unsigned u=0; u<obj->sGsm.size(); u++)
{
cout << u << ":" << obj->sGsm << endl;
}
}
}

the result as follow:
0:123456789
Hello World!

as display above, the result is right, but when free the memory, the client is coredump, and the location is "decRef(this->_ptr);"

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    The most common reason for this problem is a library mixup, i.e.: you're compiling your application in debug mode but link with ice.lib and iceutil.lib instead of iced.lib and iceutild.lib.

    See this FAQ.

    Cheers,
    Benoit.
  • richardmarichardma Member richardOrganization: qqProject: wap ✭✭
    Has been resolved, thanks a lot!
    benoit wrote:
    Hi,

    The most common reason for this problem is a library mixup, i.e.: you're compiling your application in debug mode but link with ice.lib and iceutil.lib instead of iced.lib and iceutild.lib.

    See this FAQ.

    Cheers,
    Benoit.
    :D:D:D:D
Sign In or Register to comment.