zoukankan      html  css  js  c++  java
  • c++10 Seattle Clang error

    升级到C++Builder RAD 10 Settle 一些错误解决方法,使用LLVM  CLang编译器,BCC32C

    http://docwiki.embarcadero.com/RADStudio/Seattle/en/Stricter_C%2B%2B_Compilers_%28Clang-based_C%2B%2B_Compilers%29#Two-Phase_Name_Lookup_in_Templates

    Brush->Color = RGB(49, 106, 197);

    TColor cc= 0x333;

    clang and c++11 Stricter。

    [CLANG Error] ***.cpp(1993): cannot initialize a parameter of type 'System::Uitypes::TColor' with an rvalue of type 'COLORREF' (aka 'unsigned long')
    Vcl.Graphics.hpp(390): passing argument to parameter 'Value' here

    fix》(TColor)

    (TColor)

    Brush->Color =(TColor) RGB(49, 106, 197);

    TColor cc= (TColor)0x333;

    String().sprintf(TEXT("SUM(%s)"), fn);

    [CLANG Error] 1.cpp(2156): cannot pass object of non-trivial type 'String' (aka 'System::UnicodeString') through variadic method; call will abort at runtime

    fix》c_str()

    .c_str()

    String ft, fn;
    String().sprintf(L"%s %s;", ft.c_str(), fn.c_str());

    so like this ok?

    String().sprintf(_D("%s"), _D("Hello"));

     TParam *pParam, Variant val

    pParam->AsBoolean = (bool)val;

    [CLANG Error] tt.cpp(2237): ambiguous conversion for C-style cast from 'System::Variant' to 'bool'

    fix:

    pParam->AsBoolean = val.VBoolean;

     PtInRect Bound

    [CLANG Error] WndSpy.cpp(86): taking the address of a temporary object of type 'System::Types::TRect'

     PtInRect(&BoundsRect, MousePoint) && hWindow != hOldWindow)

    fix》》

    TRect arect=BoundsRect;
    PtInRect(&arect, MousePoint) && hWindow != hOldWindow)

     BCBSMP.LIB|cspin

    [ilink32 Error] Error: Unresolved external '__InitExceptBlockLDTC' referenced from D:PROGRAM FILES (X86)EMBARCADEROSTUDIO17.0LIBWIN32RELEASEBCBSMP.LIB|cspin
    [ilink32 Error] Error: Unresolved external '__Return_unwind' referenced from D:PROGRAM FILES (X86)EMBARCADEROSTUDIO17.0LIBWIN32RELEASEBCBSMP.LIB|cspin
    [ilink32 Error] Error: Unresolved external '_CatchCleanup()' referenced from D:PROGRAM FILES (X86)EMBARCADEROSTUDIO17.0LIBWIN32RELEASEBCBSMP.LIB|cspin
    [ilink32 Error] Error: Unresolved external '_ReThrowException(unsigned int, unsigned char *)' referenced from D:PROGRAM FILES (X86)EMBARCADEROSTUDIO17.0LIBWIN32RELEASEBCBSMP.LIB|cspin
    [ilink32 Error] Error: Unresolved external '_ThrowExceptionLDTC(void *, void *, void *, void *, unsigned int, unsigned int, unsigned int, unsigned char *, void *)' referenced from D:PROGRAM FILES (X86)EMBARCADEROSTUDIO17.0LIBWIN32RELEASEBCBSMP.LIB|cgauges

    seh_personality_v0

    [ilink32 Error] Error: Unresolved external '___seh_personality_v0' referenced from tt.OBJ
    [ilink32 Error] Error: Unresolved external '__Unwind_SjLj_Register' referenced from tt.OBJ
    [ilink32 Error] Error: Unresolved external '__Unwind_SjLj_Unregister' referenced from D:PROGRAM FILES (X86)EMBARCADEROSTUDIO17.0LIBWIN32DEBUGRTLE.LIB|ustring
    [ilink32 Error] Error: Unresolved external '___cxa_begin_catch' referenced from tt.OBJ
    [ilink32 Error] Error: Unresolved external '___cpp_terminate' referenced from tt.OBJ

    http://docwiki.embarcadero.com/RADStudio/Seattle/en/C%2B%2B_Compiler

    fix:

    用bcc32经典编译器,完整编译OK!

     Hide exception variables(-xv) 设置为true试试

    cxa_rethrow

    [ilink32 Error] Error: Unresolved external '___cxa_rethrow' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '___cxa_end_catch' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '__Unwind_Resume' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '__cxxabiv1::__si_class_type_info::' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '__cxxabiv1::__class_type_info::' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '___cxa_free_exception' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '___cxa_allocate_exception' referenced from ttAENCRYPT.OBJ
    [ilink32 Error] Error: Unresolved external '___cxa_throw' referenced from ttAENCRYPT.OBJ

    std::_Xbad_alloc()

    [ilink32 Error] Error: Unresolved external 'std::_Xbad_alloc()' referenced from ttQRYRESULT.OBJ
    [ilink32 Error] Error: Unresolved external 'std::_Xlength_error(const char *)' referenced from ttQRYRESULT.OBJ

     DoGetGestureOptions

     [ilink32 Error] Error: Unresolved external '__fastcall Vcl::Controls::TControl::DoGetGestureOptions(System::Set<Vcl::Controls::TInteractiveGesture, 0, 4>&, System::Set<Vcl::Controls::TInteractiveGestureOption, 0, 4>&)' referenced from tt.OBJ

    fix:

    use bcc32c no error,but component not install ok!

    use bcc32: compiler error DoGetGestureOptions, switch to bcc32c and switch bcc32 compiler ok!! component install ok!@

    add cpp and h file

    void __fastcall DoGetGestureOptions(TInteractiveGestures &Gestures, TInteractiveGestureOptions &Options);

    void __fastcall ttt::DoGetGestureOptions(TInteractiveGestures &Gestures, TInteractiveGestureOptions &Options)
    {

    }

    Unable open  BCBSMP.LIB

    Lib Path Add 

    $(BDSLIB)win32 elease

    this->DBGrid1->Options.Contains(Vcl::Dbgrids::dgRowLines);
    this->DBGridEh1->Options.Contains(Dbgrideh::dgRowLines);
    // this->DBGridEh1->Options.Contains(Gridseh::gdRowSelected);

  • 相关阅读:
    训练1-J
    训练1-K
    训练1-P
    二分查找法详解
    POJ:1094-Sorting It All Out(拓扑排序经典题型)
    POJ:2632-Crashing Robots
    POJ:1086-Parencodings
    POJ:2586-Y2K Accounting Bug
    POJ:2109-Power of Cryptography(关于double的误差)
    POJ:1328-Radar Installation
  • 原文地址:https://www.cnblogs.com/cb168/p/4778558.html
Copyright © 2011-2022 走看看