Skip to content

Error in CppSharp.h when trying to wrap UTF16 Test with C++/CLI #521

Open
@genuinelucifer

Description

@genuinelucifer

I saw the TODO in UTF16 Test and added CLI generation for the test. I figured out many of the errors but finally i get:

Error   27  error C2664: 'System::String ^clix::detail::StringMarshaler<NetFromCxx>::marshalCxxString<2,SourceType>(const clix::detail::StringTypeSelector<2>::Type &)' : cannot convert argument 1 from 'const char *const ' to 'const clix::detail::StringTypeSelector<2>::Type &'    E:\GSoC\MonoProject_2015\CppSharp_New\CppSharp\include\CppSharp.h   103

at the return statement in CppSharp.h in this function:

// Marshals to .NET from C++ strings
    template<> struct StringMarshaler<NetFromCxx> {

      template<Encoding encoding, typename SourceType>
      static System::String ^marshal(const SourceType &string) {
        // Constructs a std::[w]string in case someone gave us a char * to choke on
          return marshalCxxString<encoding, SourceType>(string);
      }

@ddobrev @tritao Any insight why this error would be there only after generating and compiling a certain code?!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions