Open MatthewFehl365 opened 2 years ago
#include "C:\Users\mxf5351\Documents\Linear-Algebra-arduino\Linear-Algebra-arduino\src\Linear_Algebra.h"
It's never a good idea to include headers using an absolute path.
Try installing the library using the Sketch > Include Library > Add .ZIP Library
menu in the Arduino IDE, and then include the relative path, e.g. #include <Linear_Algebra.h>
. If the library is not installed and included properly, the IDE will not link to it, resulting in the undefined reference
errors you're seeing.
Thank you for the help, I managed to get it to work after installing the library correctly but I also need to change the function in householdQR.cpp ComputeFactorization to not use std::copysign. I had to include the cmath header and remove the std:: namespace. Might be a small bug when compiling on ESP32 or it might be just my system.
remove the std:: namespace
That's not a good idea, the compiler will not select the right overload of these C math functions, you have to use the C++ math functions prefixed with std::
.
The latest CI run was successful for ESP32, so I'm not sure why you're seeing this error: https://github.com/tttapa/Linear-Algebra/runs/1942413800?check_suite_focus=true
It was a while ago, maybe there's a problem with a newer version of the ESP32 Arduino Core, I'll look into that on Monday.
Sounds good. Only the copysign function was throwing an error saying "std::copysign" is not a member of the std namespace.
The examples compile successfully for me using Arduino 1.8.15 and ESP32 core version 1.0.6.
Hello,
I'm trying to impliment this branch on the ESP32 but I've ran into some issues.
Code:
include "C:\Users\mxf5351\Documents\Linear-Algebra-arduino\Linear-Algebra-arduino\src\Linear_Algebra.h"
include "C:\Users\mxf5351\Documents\Linear-Algebra-arduino\Linear-Algebra-arduino\src\include\linalg\HouseholderQR.hpp"
include "C:\Users\mxf5351\Documents\Linear-Algebra-arduino\Linear-Algebra-arduino\src\include\linalg\Matrix.hpp"
void setup(){ Matrix A = { {11, 12, 13}, {21, 22, 23}, {31, 32, 33}, }; } void loop() {}
Errors: sketch\sketch_aug06a.ino.cpp.o:(.literal._ZNK6Matrix7printToER5Print[Matrix::printTo(Print&) const]+0x0): undefined reference to >)'
sketch\sketch_aug06a.ino.cpp.o: In function >)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.
Matrix::print(Print&, unsigned char, unsigned char) const' sketch\sketch_aug06a.ino.cpp.o:(.literal._Z5setupv+0x4): undefined reference to
SquareMatrix::SquareMatrix(std::initializer_list<std::initializer_listMatrix::printTo(Print&) const': C:\Users\mxf5351\Documents\Linear-Algebra-arduino\Linear-Algebra-arduino\src\include/linalg/Matrix.hpp:260: undefined reference to
Matrix::print(Print&, unsigned char, unsigned char) const' sketch\sketch_aug06a.ino.cpp.o: In functionsetup()': C:\Users\mxf5351\Documents\sketch_aug06a/sketch_aug06a.ino:10: undefined reference to
SquareMatrix::SquareMatrix(std::initializer_list<std::initializer_listI'm stumped as to why this is occurring as these functions are absolutely defined in the library.
Any thoughts or suggestions would be greatly appriciated.