Results 1 to 9 of 9

Thread: C++ IceStorm Publisher works in Debug mode but not in Release Mode

  1. #1
    nsriram is offline Registered User
    Name: Sriram Narasimhan
    Organization: UCSC
    Project: MATLAB Simulation
    Join Date
    Feb 2012
    Posts
    8

    C++ IceStorm Publisher works in Debug mode but not in Release Mode

    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
    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

    Code:
    	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());
    	}

  2. #2
    xdm's Avatar
    xdm
    xdm is online now ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    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.

  3. #3
    nsriram is offline Registered User
    Name: Sriram Narasimhan
    Organization: UCSC
    Project: MATLAB Simulation
    Join Date
    Feb 2012
    Posts
    8
    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).

  4. #4
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  5. #5
    nsriram is offline Registered User
    Name: Sriram Narasimhan
    Organization: UCSC
    Project: MATLAB Simulation
    Join Date
    Feb 2012
    Posts
    8
    Yes I am using MultiThreaded Dll /MD for Release and MultiThreaded Debug DLL /MDd for Debug.

  6. #6
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    You should also double check that you are using the correct DLLs. The Visual Studio 2010 DLLs are in the bin\vc100 directory. You should not use the DLLs in the main bin directory (built with Visual Studio 2008).

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  7. #7
    nsriram is offline Registered User
    Name: Sriram Narasimhan
    Organization: UCSC
    Project: MATLAB Simulation
    Join Date
    Feb 2012
    Posts
    8
    How can I check which version of the dlls is being used and how can I change it?

  8. #8
    xdm's Avatar
    xdm
    xdm is online now ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    That is done in your environment PATH configuration.

    See Using the Windows Binary Distribution - Ice 3.4 - ZeroC

  9. #9
    nsriram is offline Registered User
    Name: Sriram Narasimhan
    Organization: UCSC
    Project: MATLAB Simulation
    Join Date
    Feb 2012
    Posts
    8

    Thumbs up

    Yup that solved it. Thanks a lot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. why ice will be collapse in Release mode for vs2005?
    By chanchanyuan in forum Comments
    Replies: 7
    Last Post: 06-22-2009, 02:07 AM
  2. icegridnode can't start on daemon mode ?
    By ewiniar in forum Help Center
    Replies: 2
    Last Post: 05-29-2006, 05:24 AM
  3. problems with AIX in 64bit mode
    By peter.s in forum Help Center
    Replies: 5
    Last Post: 05-18-2006, 05:05 PM
  4. For mode publish&subscribe
    By terminate in forum Help Center
    Replies: 1
    Last Post: 02-09-2006, 11:55 PM
  5. Replies: 2
    Last Post: 11-16-2005, 07:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •