Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exit status 1 Error compiling for board Arduino/Genuino Uno #7

Open
pra-dan opened this issue Nov 16, 2019 · 1 comment
Open

exit status 1 Error compiling for board Arduino/Genuino Uno #7

pra-dan opened this issue Nov 16, 2019 · 1 comment

Comments

@pra-dan
Copy link

pra-dan commented Nov 16, 2019

I have just begun using this library and the first thing I tried is, compiling the string example given in this repository. i.e,

 #include <pnew.cpp>
 #include <Arduino.h>
 #include <serstream>
 #include <string>
/*
 * Test std::string
 */

struct TestString {
  static void RunTest() {
    std::ohserialstream serial(Serial);
    std::string str;
    char c;

    for(c='A';c<='Z';c++)
      str+=c;
    serial << str << std::endl;
  }
};
TestString s;

void setup() {
    Serial.begin(115200);
}

void loop() {
    delay(1000);
    s.RunTest();
}

But I am getting the error "Error compiling for board Arduino/Genuino Uno" and the verbose is :

Build options changed, rebuilding all
In file included from C:\Users\Prashant Dandriyal\Documents\Arduino\libraries\first_attempt_vector\first_attempt_vector.ino:2:0:

e:\arduino-nightly\hardware\tools\avr\avr\include\pnew.cpp:12:20: error: declaration of 'operator new' as non-function

 void* operator new(size_t size_,void *ptr_)

                    ^

e:\arduino-nightly\hardware\tools\avr\avr\include\pnew.cpp:12:20: error: 'size_t' was not declared in this scope

e:\arduino-nightly\hardware\tools\avr\avr\include\pnew.cpp:12:33: error: expected primary-expression before 'void'

 void* operator new(size_t size_,void *ptr_)

                                 ^

In file included from e:\arduino-nightly\hardware\tools\avr\avr\include\istream:24:0,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\string:33,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\streambuf:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\istream:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\serstream:19,

                 from C:\Users\Prashant Dandriyal\Documents\Arduino\libraries\first_attempt_vector\first_attempt_vector.ino:5:

e:\arduino-nightly\hardware\tools\avr\avr\include\ostream:281:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'

   class _UCXXEXPORT basic_ostream<charT,traits>::sentry

                                                  ^

In file included from e:\arduino-nightly\hardware\tools\avr\avr\include\string:33:0,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\streambuf:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\istream:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\serstream:19,

                 from C:\Users\Prashant Dandriyal\Documents\Arduino\libraries\first_attempt_vector\first_attempt_vector.ino:5:

e:\arduino-nightly\hardware\tools\avr\avr\include\istream:343:107: error: default argument for template parameter for class enclosing 'class std::basic_istream<charT, traits>::sentry'

  template <class charT,class traits = char_traits<charT> > class _UCXXEXPORT basic_istream<charT,traits>::sentry {

                                                                                                           ^

exit status 1
Error compiling for board Arduino/Genuino Uno.
@pra-dan
Copy link
Author

pra-dan commented Nov 17, 2019

I discovered that the error is caused due the library serstream.h. Hence, all the functions like std::ohserialstream serial(Serial); give out the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant