SPI.h calling from different Library

Hi,

I'm trying to compile this Sketch on a Simatic IOT2020(which is basically a Intel Galileo Gen2) but during the compiling I get some issues:

#include <SPI.h>
#include <LoRa.h>

int counter = 0;

void setup() {
Serial.begin(9600);
while (!Serial);

Serial.println("LoRa Sender");

if (!LoRa.begin(915E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}

void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);A

// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();

counter++;

delay(5000);

}

Issues:

In file included from C:\Users\hladik\Desktop\arduino-1.8.2\LoRaReceiver\LoRaReceiver.ino:2:0:

C:\Users\hladik\Documents\Arduino\libraries\LoRa\src/LoRa.h:74:3: error: 'SPISettings' does not name a type

Could somebody help me with this?

By the way: when I compile it for a Arduino Mega 2560 everything runs propertly.

I'm trying to run this Sketch on a Simatic IOT2020 but during the compiling I get some issues:

How can you run code that won't compile?

You can NOT call a header file. You can only call functions.

Your problem has NOTHING to do with SPI.h.

You need to post a link to the library that IS causing you issues.

Sorry, I made a mistake here:

I'm trying to compile it and then get this issue.

The Library can be found here: arduino-LoRa/src at master · sandeepmistry/arduino-LoRa · GitHub

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here using code tags.

After downloading the LoRa library, and removing the extraneous A from your sketch, I got:

Sketch uses 3618 bytes (11%) of program storage space. Maximum is 30720 bytes.
Global variables use 295 bytes (14%) of dynamic memory, leaving 1753 bytes for local variables. Maximum is 2048 bytes.

when compiling your sketch. Since you didn't mention which Arduino you compiled for, I won't, either.

Error messages are:

Arduino: 1.8.2 (Windows 10), Board: "Intel® Galileo Gen2"

In file included from C:\Users\hladik\Desktop\arduino-1.8.2\LoRaReceiver\LoRaReceiver.ino:2:0:

C:\Users\hladik\Documents\Arduino\libraries\LoRa\src/LoRa.h:74:3: error: 'SPISettings' does not name a type

exit status 1
Fehler beim Kompilieren für das Board Intel® Galileo Gen2.

As already mentioned I have this error only when I'm trying to compile it for a IntelGalileo Gen2, on a Mega 2650 it works fine.

But I already found the Reason.
When you are compiling for a Intel Galileo it uses a different SPI.h, that is made for the Galileo Gen2.
Problem with this SPI.h version is, that the function SPISettings is missing.