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?
am using compiler v6.10.1 to enable c++ 11 features
You still have to tell it whether you want it to compile as C or C++
compiling SysMng.c...
By default, it will compile a file .c extension as C - not C++
i managed to solve the problem using extern c in cpp files but there is another problem that crash the debugging and it doesn't run to main !!
linking... .\Objects\ELKREM.axf: Warning: L6776W: The debug frame in .debug_frame(spark_wiring_string.o) does not describe an executable section. Program Size: Code=230416 RO-data=58212 RW-data=1944 ZI-data=88032
can you help me , thanks in advance
so start another thread!
You can always provide a link back to this one, for reference.
And provide a link here
So you couldn't be bothered, then? http://www.keil.com/forum/63946
View all questions in Keil forum