I did not include anything in the main.c file, when I build for esp32 I get this error:
.../esp32/build_contexts/build_ctx_828592047/build/objs/mosapp/libmosapp.a(mgos_deps_init.o):(.rodata.descrs+0x44): undefined reference to `mgos_arduino_lora1276_init'
collect2: error: ld returned 1 exit status
at this point I’m not sure what is the problem, any guidance is appreciated.
@nliviu
I’m trying to use the library but I think I miss something here not sure what.
now inside my app. “main.c”
#include "mgos_arduino_lora1276.h"
.
other code
.
/* Main Loop Call ------------------------------------------------------------------*/
enum mgos_app_init_result mgos_app_init(void)
{
/* Pins set up */
mgos_gpio_set_mode(mgos_sys_config_get_pins_led1(), MGOS_GPIO_MODE_OUTPUT);
mgos_gpio_set_mode(mgos_sys_config_get_pins_led2(), MGOS_GPIO_MODE_OUTPUT);
...
/* Setup Lora1276 */
if(!mgos_LORA_init())
LOG(LL_INFO, ("Lora Not initialized"));
...
return MGOS_APP_INIT_SUCCESS;
}
doing this gives me several errors related to class LORA in the original header file.
build_ctx_177209192/build/objs/nvs_flash/src/nvs_api.o
build_contexts/build_ctx_177209192/deps/arduino-lora1276/include/mgos_arduino_lora1276.h:15:0,
build_contexts/build_ctx_177209192/src/main.c:12:
build_contexts/build_ctx_177209192/deps/arduino-lora1276/include/LORA.h:198:1: error: unknown type name 'class'
class LORA
^
build_contexts/build_ctx_177209192/deps/arduino-lora1276/include/LORA.h:199:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{
^
build_contexts/build_ctx_177209192/src/main.c:12:0:
build_contexts/build_ctx_177209192/deps/arduino-lora1276/include/mgos_arduino_lora1276.h:18:5: error: unknown type name 'LORA'
LORA *mgos_LORA_create(int NSSPin, int NRESETPin, int txEnPin, int rxEnPin);
^
build_contexts/build_ctx_177209192/deps/arduino-lora1276/include/mgos_arduino_lora1276.h:20:26: error: unknown type name 'LORA'
void mgos_LORA_close(LORA *lora);
^
build_contexts/build_ctx_177209192/deps/arduino-lora1276/include/mgos_arduino_lora1276.h:23:25: error: unknown type name 'LORA'
bool mgos_LORA_init(LORA *lora);
^
and the same on all other lines where LORA is used.