Go Down

Topic: Can't compile the PrintEx examples (Read 322 times) previous topic - next topic

jsantosrico

I downloaded the PrintEX library from the library manager. I try to compile one of their examples for the Arduino Zero (and the Sodaq ONE board, for that matter, that is based on it), and it fails in both cases. I have the latest version of the boards and the drivers, as well as the latest IDE. The error I'm getting is about "va_list" not being declared. Any clues??? I would open a case at their github, but it looks pretty dead there, with the latest interactions around December 2016.

Thanks!

Code: [Select]
In file included from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/Globals.h:29:0,

                 from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/NonStreamingIO.h:24,

                 from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/MemoryPrinter.h:24,

                 from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/PrintEx.h:26,

                 from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\examples\basic_usage\basic_usage.ino:8:

c:\users\joel\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstdarg:54:11: error: '::va_list' has not been declared

   using ::va_list;

           ^

In file included from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/MemoryPrinter.h:25:0,

                 from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/PrintEx.h:26,

                 from C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\examples\basic_usage\basic_usage.ino:8:

C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/PrintExtension.h: In member function 'pft PrintExWrap<T>::printf(const char*, ...)':

C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/PrintExtension.h:129:13: error: 'va_list' was not declared in this scope

             va_list vList;

             ^

C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/PrintExtension.h:129:21: error: expected ';' before 'vList'

             va_list vList;

                     ^

In file included from C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.16\cores\arduino/Print.h:90:0,

                 from C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.16\cores\arduino/Stream.h:26,

                 from C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.16\cores\arduino/HardwareSerial.h:24,

                 from C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.16\cores\arduino/Arduino.h:78,

                 from sketch\basic_usage.ino.cpp:1:

C:\Users\Joel\Desktop\Dropbox\Arduino\libraries\arduino_109576\src/lib/PrintExtension.h:130:23: error: 'vList' was not declared in this scope

             va_start( vList, format );

                       ^

exit status 1
Error compiling for board Arduino/Genuino Zero (Programming Port).

pert

What happens if you compile the example for Arduino/Genuino Uno?

jsantosrico

It does compile, but there's a badge on their github that says that other architectures are also supported, so it should compile on the Zero too. It happened to me before with a different library, that used a buffer that was present in a certain version of the Arduino core libraries and was later removed from them and I had to manually add it. But in this case, I don't know what the error is referring to, so I don't know how to fix it, or if just adding those declarations would break other things.

jsantosrico

Look at that! I downgraded the board with the board manager, and it worked. I started to try different versions and all worked. And then I got back to the latest version, AND IT WORKED TOO!!!!!

I'm as puzzled as angry. What a way to lose a whole day... grrr....... at least it works now on the Zero.

About my particular board, the Sodaq ONE, I was not that lucky, and no matter what version I use, starting from v1.6.8, the first one to include the ONE, it never compiles... back to square one.

pert

Examine the output in the console window to compare the compiler version used by Arduino SAMD boards when you compile for Zero to when you compile for Sodaq ONE. In the output above you can see it on this line:
Code: [Select]
c:\users\joel\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstdarg:54:11: error: '::va_list' has not been declared
In that output it's using arm-non-eabi-gcc 4.8.3-2014q1.

Go Up