using <iostream> cause error

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys, I get the following error when I include the <iostream> in a .cpp file.  This error is no doubt a makefile flag problem.  Is there a flag to ignore this error????

 

 

 

DEP ../../examples/getting_started_with_blue/test.cpp
CC ../../examples/getting_started_with_blue/test.cpp
In file included from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h:44:0,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\bits\basic_string.h:5417,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\string:52,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\bits\locale_classes.h:40,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\bits\ios_base.h:41,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ios:42,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ostream:38,
                 from d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\iostream:39,
                 from ../../examples/getting_started_with_blue/test.cpp:8:
d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h: In constructor '__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...)::_Save_errno::_Save_errno()':
d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h:63:27: error: 'errno' was not declared in this scope
  _Save_errno() : _M_errno(errno) { errno = 0; }
                           ^
d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h: In destructor '__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...)::_Save_errno::~_Save_errno()':
d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h:64:23: error: 'errno' was not declared in this scope
  ~_Save_errno() { if (errno == 0) errno = _M_errno; }
                       ^
d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h: In function '_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...)':
d:\arm dependencies\gcc-arm\arm-none-eabi\include\c++\6.3.1\ext\string_conversions.h:72:16: error: 'errno' was not declared in this scope
       else if (errno == ERANGE
                ^
make: *** [../../scripts/Makefile.rules:100: build/sama5d4-xplained/ddram/examples/getting_started_with_blue/test.o] Error 1
 

 

Last Edited: Sun. Feb 2, 2020 - 01:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The error now is as follows:

 

02:14:47 **** Build of configuration Default for project test ****
make TARGET=sama5d4-xplained 
DEP ../../examples/getting_started_with_blue/test.cpp
CC ../../examples/getting_started_with_blue/test.cpp
LINK build/sama5d4-xplained/ddram/getting-started_with_blue.elf
./build/sama5d4-xplained/ddram/examples/getting_started_with_blue/test.o: In function `__static_initialization_and_destruction_0(int, int)':
test.cpp:(.text+0x94): undefined reference to `std::ios_base::Init::Init()'
test.cpp:(.text+0xa0): undefined reference to `std::ios_base::Init::~Init()'
test.cpp:(.text+0xa4): undefined reference to `std::ios_base::Init::~Init()'
collect2.exe: error: ld returned 1 exit status
make: *** [../../scripts/Makefile.rules:115: build/sama5d4-xplained/ddram/getting-started_with_blue.elf] Error 1
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why do you want to ignore the error? Surely you want to resolve it? It can’t find errno. This needs to be fixed. How? Dig deep.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


My comments are the same as on 19-January:  https://www.avrfreaks.net/commen...

theusch wrote:

 

 

Fianawarrior wrote:

Guys,  I installed ARM GCC 8

 

I must have missed something, not rigorously monitoring the forums.  Is this now an ARM place?  As I recall, this poster has done this in the past.  IMO addressing his query here is encouragement, not discouragement.

 

 

Curiously in the intervening couple weeks the OP did indeed post several things in ARM-World:

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.