Archived
This forum has been archived. Please start a new discussion on GitHub.
C++ IceStorm Publisher works in Debug mode but not in Release Mode
nsriram
in Help Center
I am trying to publish to an IceStorm Service from MATLAB using the Mex Interface. Things work when I compile the Mex file in Debug (in Visual Studio 2010) but not in Release Mode. When I run it in Release mode I get the following error
Just for reference this is the code I use to initialize
Exception when trying to initialize ice.
Instance.cpp:427: Ice::IdentityParseException:
error while parsing identity `invalid identity name `hÜÂ
Just for reference this is the code I use to initialize
try {
string topicManagerStr = "DemoIceStorm/TopicManager:tcp -h 127.0.0.1 -p 10203";
m_communicator = Ice::initialize();
Ice::ObjectPrx proxyBase = m_communicator->stringToProxy(topicManagerStr);
mexPrintf("Created Connection\n");
TopicManagerPrx manager = TopicManagerPrx::checkedCast(proxyBase);
TopicPrx hbTopic = manager->retrieve(slice::hats::hatsHbTopicName);
mexPrintf("Got heartbeat topic\n");
m_heartBeatProxy = HeartBeatPrx::uncheckedCast(hbTopic->getPublisher()->ice_oneway());
TopicPrx tmTopic = manager->retrieve(slice::hats::hatsTlmTopicName);
mexPrintf("Got tlm topic\n");
m_telemetryProxy = TelemetryPrx::uncheckedCast(tmTopic->getPublisher()->ice_oneway());
string message = "Initialized connection to : ";
message.append(topicManagerStr);
message.append("\n");
mexPrintf(message.c_str());
} catch (exception& e) {
ostringstream ost;
ost << "Exception when trying to initialize ice. " << endl
<< e.what() << endl;
mexErrMsgTxt(ost.str().c_str());
}
0
Comments
-
Hi Sriram,
Are you linking with Ice release libraries when building in release mode?
For release builds:
Ice.lib, IceUtil.lib, IceStorm.lib
And for debug builds:
Iced.lib, IceUtild.lib, IceStormd.lib
And for other libs you link with is the same, you must not mix release/debug libs, this can cause strange errors as you will end with two versions of C runtime one for debug one for release.0 -
The strange thing is I am linking with the release libs Ice.lib IceUtil.lib etc. even when I am building in Debug mode. So I would expect things to break in Debug mode but no... Also if I try to link Iced.lib etc when building Debug I get an application cannot start error (which crashes MATLAB too).0
-
For the Ice libraries, "debug" means built with /MDd, while "release" means built with /MD.
See /MD, /MT, /LD (Use Run-Time Library).
Your own Ice-based application should use the same option as the Ice libraries you link with. Can you confirm which option you use?
Best regards,
Bernard0 -
That is done in your environment PATH configuration.
See Using the Windows Binary Distribution - Ice 3.4 - ZeroC0
