This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Compiler directives needed?

Tags: None
(comma "," separated)
mconsidine
Registered Member
Posts
2
Karma
0

Compiler directives needed?

Sat Mar 12, 2016 10:44 pm
Hi,
I have had versions 3.2.4 - 3.2.8 of the Eigen library successfully compiling with an example program on a Linux system (Xubuntu, "Wily Werewolf") using the Arduino/Teensyduino IDE (v1.6.8). When I try to swap in version 3.3.1 beta 1, however, a number of errors are generated, e.g. :
In file included from /home/matt/Downloads/arduino-1.6.8/hardware/teensy/avr/cores/teensy3/WProgram.h:15:0,
from /home/matt/Downloads/arduino-1.6.8/hardware/teensy/avr/cores/teensy3/Arduino.h:1,
from /tmp/build05ea79966117b24e0fb82be583ac0586.tmp/sketch/Eigen_test.ino.cpp:1:
/home/matt/Downloads/arduino-1.6.8/hardware/teensy/avr/cores/teensy3/wiring.h:80:19: error: expected unqualified-id before '{' token
#define round(x) ({ \
^
/home/matt/Arduino/libraries/Eigen331b1/Eigen/src/Core/MathFunctions.h:936:45: note: in expansion of macro 'round'
inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)


(There are others like that, though excluded here).

It seems to me that perhaps the 3.3.1 version of the library might require some specific compiler directives that were not needed before. Can anyone tell me if that is correct and if so, what those directives should be? Or, if I am completely off base and someone can point that out (along with a solution), I'd be appreciative.
Regards,
Matt
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Compiler directives needed?

Tue Mar 15, 2016 9:27 am
Either #include Eigen's headers first, or #undef the offending macros like "round" before including Eigen's header (or any c++ header):

#ifdef round
#undef round
#endif
mconsidine
Registered Member
Posts
2
Karma
0

Re: Compiler directives needed?

Tue Mar 15, 2016 11:57 pm
Thank you - that fixed it.
Regards,
Matt


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft