2
votes

I'm trying to compile CppUtest as library on IAR workbench v6.3.3 for the AVR UC3C0512C on Windows 7 x64 but when I compile it, it says that the std name space is not defined.

Here is the snipped of code where I get the first error, the file is SimpleString.h:

#if CPPUTEST_USE_STD_CPP_LIB
  #include <string>
  #include <stdint.h>

  SimpleString StringFrom(const std::string& other);

The last line contains the std::string and this brings me 190 errors all related to this. The message is :

Error[Pe276]: name followed by "::" must be a class or namespace name
C:\COM\SRC\cpputest35\include\CppUTest\SimpleString.h 143 

I have tried using the line below but it does not help:

using namespace std;

enter image description here

Under Library Configuration I select Normal DLIB, I also tried with Full DLIB but IAR can't see the std library

enter image description here

Any ideas please?

1
AVR is supported by GCC which fully supports ISO C++ rather than EC++. EC++ is largely obsolete. - Clifford
We are in the process to migrate the project to GCC but it is not an easy task. - Snake Sanders

1 Answers

3
votes

According to the IAR manuals

The std namespace is not used in either standard EC++ or in Extended EC++. If you 
have code that refers to symbols in the std namespace, simply define std as nothing; 
for example:
#define std // Nothing here