How to write C libraries in Arduino libraries folder ?
Of course with a C library I get this error.
Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\tvtc_\AppData\Local\Temp\cc7ua8lH.ltrans0.ltrans.o: In function `setup':
C:\Users\tvtc_\Desktop\lib1/lib1.ino:6: undefined reference to `mod_init()'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
#include "libtest.h"
void setup() {
// put your setup code here, to run once:
mod_init();
}
void loop() {
// put your main code here, to run repeatedly:
}
Is there a way that I can write C libraries for both Arduino IDE and Atmel Studio, without modifying the library extension.
Is your method specifically, defines the things in the middle to be C stuff ? If that's true then the 2nd method is more easier as I understood that method 2 means that everything after that extern identifier is a C code.