-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example compilation fail for SAMD21 in Arduino IDE #15
Comments
The most likely problem is that you need to If you are using the example code, you may be able to place |
It looks like there might be a way to add compiler flags in a |
Thanks for reply, I already add #define ARDUINO_LORA but nothing changed |
Those memcpy's and memcmp's are throwing errors because the correct header is not being included which is happening because ARDUINO_LORA is not being defined at a global level (i.e. at compile time). I guess a solution could be to make ARDUINO_LORA the default by adding a guard at the top of Layer1_LoRa.h and LoRaLayer2.h that would define ARDUINO_LORA as long as the other two options (RL_SX1276 and SIM) are not defined. I'll give this a shot and let you know if it works. |
That solution doesn't appear to work for me in platformio, it causes linker errors now. I don't think there is a good work around to not using a build flag. By creating a default setting, I can now compile, but I am not able to link. I'm not sure why the linker errors are happening, but I'm guessing it doesn't like ARDUINO_LORA not being globally defined. |
I included D:\arduino-1.8.8-d11\portable\sketchbook\router_beacon/router_beacon.ino:23: undefined reference to `Layer1Class::Layer1Class()' D:\arduino-1.8.8-d11\portable\sketchbook\router_beacon/router_beacon.ino:24: undefined reference to `Layer1Class::setPins(int, int, int)' D:\arduino-1.8.8-d11\portable\sketchbook\router_beacon/router_beacon.ino:25: undefined reference to `Layer1Class::setLoRaFrequency(unsigned long)' D:\arduino-1.8.8-d11\portable\sketchbook\router_beacon/router_beacon.ino:26: undefined reference to `Layer1Class::init()' libraries\LoRaLayer2\LoRaLayer2.cpp.o: In function `LL2Class::daemon()': D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:573: undefined reference to `Layer1Class::getTime()' D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:581: undefined reference to `Layer1Class::getTime()' D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:582: undefined reference to `Layer1Class::transmit()' D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:587: undefined reference to `Layer1Class::getTime()' D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:588: undefined reference to `Layer1Class::spreadingFactor()' D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:597: undefined reference to `Layer1Class::receive()' D:\arduino-1.8.8-d11\portable\sketchbook\libraries\LoRaLayer2\src/LoRaLayer2.cpp:577: undefined reference to `Layer1Class::getTime()' collect2.exe: error: ld returned 1 exit status exit status 1 |
I am using this LoRa Library https://github.com/sandeepmistry/arduino-LoRa |
Yes, those are the linker errors I was talking about. Ok, so I've found the solution. You need to put the compiler flag in a file named In the For reference, I found that solution here, https://stackoverflow.com/questions/28037491/arduino-1-0-6-how-to-change-compiler-flag |
same erros as above |
Hi, I am beginner in this high level programing,
I try compile this library in Arduino IDE for Armachat project with SAMD21 (etc Arduino Zero)
I get lot of errors and I have no idea how to fix.
Including errors in file.
error.txt
Can anybody help?
THANKS
The text was updated successfully, but these errors were encountered: