Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice 3.4.1 and C# - compilation errors with --stream option

Hi,

I am trying to enable ice streaming option (with C#/.NET) to load ice objects from data dump. After reading chapter on "Streaming Interface", I enabled the --stream option in the Visual Studio Ice Configuration to make use of the Dictionary and Struct helper functions.

But, I am now getting following Ice compilation errors:
Error 1 The best overloaded method match for 'Ice.FloatSeqHelper.write(IceInternal.BasicStream, float[])' has some invalid arguments Common.cs 5733
Error 2 Argument '1': cannot convert from 'Ice.OutputStream' to 'IceInternal.BasicStream' Common.cs 5733
Error 3 The best overloaded method match for 'Ice.FloatSeqHelper.read(IceInternal.BasicStream)' has some invalid arguments Common.cs 5776
Error 4 Argument '1': cannot convert from 'Ice.InputStream' to 'IceInternal.BasicStream' Common.cs 5776
Error 5 The best overloaded method match for 'Ice.FloatSeqHelper.write(IceInternal.BasicStream, float[])' has some invalid arguments Common.cs 7029
Error 6 Argument '1': cannot convert from 'Ice.OutputStream' to 'IceInternal.BasicStream' Common.cs 7029
Error 7 The best overloaded method match for 'Ice.FloatSeqHelper.read(IceInternal.BasicStream)' has some invalid arguments Common.cs 7042
Error 8 Argument '1': cannot convert from 'Ice.InputStream' to 'IceInternal.BasicStream' Common.cs 7042

Below is the Ice auto-generated code snippet that the error is pointing to:
[_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.4.1")]
public void ice_write(Ice.OutputStream outS__)
{
if(mValues == null)
{
outS__.writeSize(0);
}
else
{
outS__.writeSize(mValues.Length);
for(int ix__ = 0; ix__ < mValues.Length; ++ix__)
{
Ice.FloatSeqHelper.write(outS__, mValues[ix__]);
}
}

Any clues?

Comments

  • mes
    mes California
    Hi,

    Ice.dll includes the code that was generated for BuiltinSequences.ice. Unfortunately, this Slice file was not compiled with the --stream option, which prevents you from using any of these types as members in your own streamable types. The simplest solution is to define your own sequence types and not use any definitions from BuiltinSequences.ice.

    Regards,
    Mark
  • Hmm... I have a set of Slice definitions that include classes which contain Ice::StringSeq members, and these translate/compile into an assembly just fine using Mono. I have confirmed that "--stream" is being passed to slice2cs when the translation is performed.

    I have also compiled code that receives one of these objects as a parameter to a remote operation, and that compiled fine too.

    Is the original poster's situation something different?
  • xdm
    xdm La Coruña, Spain
    Hi Kevin,

    The difference is that you are using a sequence of a basic type, when the original poster's is using a sequence of sequences, sequences of basic types doesn't generate extra code with --stream option, in your case the generated code use the build-in methods to write the sequence, Ice.OutputStream.WriteStringSeq in that case.

    Jose