Domanda

I'm trying to compile CppUTest as a 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 namespace is not defined.

Here is the snippet 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?

È stato utile?

Soluzione

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top