Issues Linking Eigen lib

Status
Not open for further replies.

adam1016

New member
Hello - I am having issues compiling the Eigen linear algebra library for teensy, first off here is the link to my github for the project: https://github.com/tobycyanide/teensytracer
As far as I can tell this issue is because of the Teensy lib overriding the abs and round functions from the stdlib. I've been advised to move the teensy-specific code into a seperate file and create a C wrapper, and then import that wrapper, to create another layer of abstraction between the teensy core and my app code. However, I have no idea how to do this, I thought I would post here for some guidance.
I'm getting errors like this:
Code:
error: expected unqualified-id before '(' token
  121 | #define abs(x) ({ \
My source code is on the github, I'm passing -DDO_ARM=1 to build the teensy.


Thanks so much,
Adam
 
In most cases, you can just undefine these annoying macros.
Here's what I use in my Linear Algebra library: ArduinoMacroFix.hpp.
You have to include it before including any Eigen headers (and <cmath> or <algorithm>).

Pieter
 
Status
Not open for further replies.
Back
Top