Re: [eigen] Eigen on Arduino Due (32-bit Microcontroller with GCC) Windows 10 Compile Error

[ Thread Index | Date Index | More Archives ]

Yes, I did try adding <stdio.h> on top with no luck.

Just want to mention again that this is a Windows 10 problem, not Windows 7.

I did find a good workaround.  I traced the problem to <cstdio>.  The same compile occurs even if this is the only header in the program.  So I made backup copy of <cstdio> (file enclosed), then commented out line 77:

#undef printf

Now Eigen works.  <algorithm> is dependent on <cstdio>, and Eigen is dependent on <algorithm> as you pointed out, so this modification solves the problem for now.  I brought it up in the Arduino forum.  Hopefully the Arduino developers can find a more permanent solution.  

On Tuesday, March 15, 2016 2:24 AM, Gael Guennebaud <gael.guennebaud@xxxxxxxxx> wrote:

<algorithm> is needed for std::min/max, so we cannot get rid of this dependency. There must be something wrong in your settings, because #including <algorithm> should not break this way. Better ask on a forum dedicated to arduino. Nonetheless, have you tried the suggestion of Christoph to #include <stdio.h> before any other header?


On Mon, Mar 14, 2016 at 5:50 PM, A B <randomvibe@xxxxxxxxxxxxxx> wrote:
Yes, I get the error with just <cstdio> or just <algorithm>.  So the issue is independent of Eigen.  If I don't call any of these including Eigen, programs compile correctly.  Is there anything I can do to my Eigen to push this through? 

On Monday, March 14, 2016 4:57 AM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:


Do you get the same error when including just <algorithm> or just
<cstdio>? If so, it seems your C++-std-lib is defect and you should
report this problem to whoever provided it.

It might be possible to work-around this by including <stdio.h> before
any other library (though it actually does not seem right that
<algorithm> indirectly depends on <cstdio>).


On 2016-03-14 11:57, A B wrote:
> To the Community,
> Hello..  I have used Eigen successfully on several of my robotics projects with the Arduino Due 32-bit microtroller on a Windows 7 64-bit PC.  I use Eigen to perform extensive matrix operations as part of the feedback control system.
> All compiled normally on the Arduino-1.6.6 IDE, which uses the GCC compiler, until I upgraded to Windows 10 on a 64-bit PC.  I simplified the Arduino program which reproduces the compile error:
> #include  <Eigen320.h>
> void setup() {
> }
> void loop() {
> }
> Here's the compile error.  Your help is appreciated.  Thank you.
> In file included from c:\users\mc\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\random:39:0,
>                  from c:\users\mc\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits\stl_algo.h:65,
>                  from c:\users\mc\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\algorithm:62,
>                  from C:\Programs\arduino-1.6.6\libraries\Eigen320/Eigen\Core:148,
>                  from C:\Programs\arduino-1.6.6\libraries\Eigen320/Eigen320.h:35,
>                  from D:\$projects\mcu\arduino\test\test.ino:2:
> c:\users\mc\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstdio:122:11: error: '::printf' has not been declared
>    using ::printf;
>            ^
> exit status 1
> Error compiling.


  Dipl. Inf., Dipl. Math. Christoph Hertzberg

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 1
  28359 Bremen, Germany

  Zentrale: +49 421 178 45-6611

  Besuchsadresse der Nebengeschäftsstelle:
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Tel.:    +49 421 178 45-4021
  Empfang: +49 421 178 45-6600
  Fax:    +49 421 178 45-4150
  E-Mail:  chtz@xxxxxxxxxxxxxxxxxxxxxxxx

  Weitere Informationen:

Attachment: cstdio
Description: Binary data

Mail converted by MHonArc 2.6.19+