We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi, am using keil mdk5.26 to build c and c++ files and when i enclude <iostream> in header files that contain classes and cpp features it gives me 19 error as followas:
*** Using Compiler 'V6.10.1', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' Build target 'Target 1' Application/SysMng.c(4): warning: In file included from... ./decentlib/src\elkrem.h(13): warning: In file included from... ./decentlib/src/Arduhdlc.h(12): warning: In file included from... C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iostream(38): warning: In file included from... C:/Keil_v5/ARM/ARMCLANG/include/libcxx\ios(215): warning: In file included from... C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(96): error: unknown type name '_LIBCPP_BEGIN_NAMESPACE_STD' _LIBCPP_BEGIN_NAMESPACE_STD ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(98): error: expected ';' after top level declarator class _LIBCPP_TYPE_VIS ios_base; ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(100): error: unknown type name 'template' template<class _CharT> struct _LIBCPP_TEMPLATE_VIS char_traits; ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(100): error: expected identifier or '(' template<class _CharT> struct _LIBCPP_TEMPLATE_VIS char_traits; ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(101): error: unknown type name 'template' template<class _Tp> class _LIBCPP_TEMPLATE_VIS allocator; ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(101): error: expected identifier or '(' template<class _Tp> class _LIBCPP_TEMPLATE_VIS allocator; ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(103): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(103): error: expected identifier or '(' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(106): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(106): error: expected identifier or '(' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(108): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(108): error: expected identifier or '(' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(110): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(110): error: expected identifier or '(' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(112): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(112): error: expected identifier or '(' template <class _CharT, class _Traits = char_traits<_CharT> > ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(115): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT>, ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(115): error: expected identifier or '(' template <class _CharT, class _Traits = char_traits<_CharT>, ^ C:/Keil_v5/ARM/ARMCLANG/include/libcxx\iosfwd(118): error: unknown type name 'template' template <class _CharT, class _Traits = char_traits<_CharT>, ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. compiling SysMng.c... ".\Objects\ELKREM.axf" - 19 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:03
## what should i do
You have configured it to compile as C++ (not just 'C') - haven't you?