Menu

compile error c++

2022-02-25
2022-02-25
  • CARLOS EDUARDO PIRES DE SÁ

       UniString( const char * Str ) : m_string( Str ), m_wstring( m_string.begin(), m_string.end() ) {}
        UniString( const std::string & Str ) : m_string( Str ), m_wstring( m_string.begin(), m_string.end() ) {}
    
        UniString( const wchar_t * Str ) : m_wstring( Str )
        {
            m_string = UTF8Encoder::From_wstring( m_wstring );
        }
        UniString( const std::wstring & Str ) : m_wstring( Str )
        {
            m_string = UTF8Encoder::From_wstring( m_wstring );
        }
    

    error
    :\novavarredura\emdesenvolvimento\cck_csv\simplexlsxdef.h(57) : error C2664: '__thiscall std::basic_string<unsigned short,struct="" std::char_traits\<unsigned="" short="">,class std::allocator\<unsigned short=""> >::std::basic_string<unsigned short,struct="" std::c="" har_traits\<unsigned="" short="">,class std::allocator\<unsigned short=""> >(const unsigned short ,unsigned int,const class std::allocator<unsigned short=""> &)' : cannot convert parameter 1 from 'char </unsigned>' to 'const unsigned short '
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    c:\novavarredura\emdesenvolvimento\cck_csv\simplexlsxdef.h(58) : error C2664: '__thiscall std::basic_string<unsigned short,struct="" std::char_traits\<unsigned="" short="">,class std::allocator\<unsigned short=""> >::std::basic_string<unsigned short,struct="" std::c="" har_traits\<unsigned="" short="">,class std::allocator\<unsigned short=""> >(const unsigned short </unsigned></unsigned></unsigned></unsigned>
    ,unsigned int,const class std::allocator<unsigned short=""> &)' : cannot convert parameter 1 from 'char ' to 'const unsigned short '
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast</unsigned></unsigned></unsigned></unsigned></unsigned>

     
  • Alexandr Belyak

    Alexandr Belyak - 2022-02-25

    Hello CARLOS EDUARDO PIRES DE SÁ,
    Thanks for the feedback.
    What version of the compiler and its launch options? What version of the operating system?
    Can you provide a minimal example of a program with such an error?

     

Log in to post a comment.

MongoDB Logo MongoDB