ERROR ld.exe variable definida previamente

hola, buenas tardes,

tengo esta cabecera menuAdmin.h

#include "cabeceras.h"

#ifndef MENUADMIN_H
#define MENUADMIN_H

//#### ADMINISTRACION ####

#define PIN_CREA_TARJ_ADM   13

//#### MENU ADMINISTRACION ####

#define NRO_ITEMS_MENU_ADMIN    9

#define VER_CREDITOS_CARGADOS                 1
#define VER_CREDITOS_SIN_CARGAR               2
#define REINICIAR_CONTADOR_CREDITOS_CARGADOS  3
#define DEFINIR_CREDITOS_PARA_CARGA           4
#define VER_TARJETAS_CARGADAS                 5
#define REINICIAR_CONTADOR_TARJETAS_CARGADAS  6
#define CREAR_TARJETA_ADMINISTRACION          7
#define BORRAR_TARJETA_ADMINISTRACION         8
#define SALIR_MODO_ADMINISTRACION             9

struct MenuAdmin
{
  uint8_t nroItem;
  char LCDlinea0[16];
  char LCDlinea1[16];
} menuAdmin[NRO_ITEMS_MENU_ADMIN];

bool modoAdministracion = false;
volatile bool estINTcreaTarjAdm=false;

#endif

el archivo cabeceras.h es este

#ifndef CABECERAS_H
#define CABECERAS_H

#include <Arduino.h>
#include <stdint.h>
#include <stdbool.h>
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>

#endif

y aunque menuAdmin.h está encerrado en un ifndef, cuando compilo salta este error

c:/users/dnpcw/appdata/local/arduino15/packages/rp2040/tools/pqt-gcc/2.0.0-a-d3d2e6b/bin/../lib/gcc/arm-none-eabi/12.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\dnpcw\AppData\Local\Temp\arduino\sketches\D28147D8B51CDFA1A04557FD8835AC96\sketch\menuAdmin.cpp.o:C:\Users\dnpcw\GDrive\DSD\en proceso\Tarjetas MIFARE\RPIpico\fuentes Arduino IDE\RPI-Pico_grabador_KY040/menuAdmin.h:32: multiple definition of `estINTcreaTarjAdm'; C:\Users\dnpcw\AppData\Local\Temp\arduino\sketches\D28147D8B51CDFA1A04557FD8835AC96\sketch\RPI-Pico_grabador_KY040.ino.cpp.o:C:\Users\dnpcw\GDrive\DSD\en proceso\Tarjetas MIFARE\RPIpico\fuentes Arduino IDE\RPI-Pico_grabador_KY040/menuAdmin.h:32: first defined here

c:/users/dnpcw/appdata/local/arduino15/packages/rp2040/tools/pqt-gcc/2.0.0-a-d3d2e6b/bin/../lib/gcc/arm-none-eabi/12.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\dnpcw\AppData\Local\Temp\arduino\sketches\D28147D8B51CDFA1A04557FD8835AC96\sketch\menuAdmin.cpp.o:C:\Users\dnpcw\GDrive\DSD\en proceso\Tarjetas MIFARE\RPIpico\fuentes Arduino IDE\RPI-Pico_grabador_KY040/menuAdmin.h:31: multiple definition of `modoAdministracion'; C:\Users\dnpcw\AppData\Local\Temp\arduino\sketches\D28147D8B51CDFA1A04557FD8835AC96\sketch\RPI-Pico_grabador_KY040.ino.cpp.o:C:\Users\dnpcw\GDrive\DSD\en proceso\Tarjetas MIFARE\RPIpico\fuentes Arduino IDE\RPI-Pico_grabador_KY040/menuAdmin.h:31: first defined here

c:/users/dnpcw/appdata/local/arduino15/packages/rp2040/tools/pqt-gcc/2.0.0-a-d3d2e6b/bin/../lib/gcc/arm-none-eabi/12.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\dnpcw\AppData\Local\Temp\arduino\sketches\D28147D8B51CDFA1A04557FD8835AC96\sketch\menuAdmin.cpp.o:C:\Users\dnpcw\GDrive\DSD\en proceso\Tarjetas MIFARE\RPIpico\fuentes Arduino IDE\RPI-Pico_grabador_KY040/menuAdmin.h:29: multiple definition of `menuAdmin'; C:\Users\dnpcw\AppData\Local\Temp\arduino\sketches\D28147D8B51CDFA1A04557FD8835AC96\sketch\RPI-Pico_grabador_KY040.ino.cpp.o:C:\Users\dnpcw\GDrive\DSD\en proceso\Tarjetas MIFARE\RPIpico\fuentes Arduino IDE\RPI-Pico_grabador_KY040/menuAdmin.h:29: first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

alguien me puede ayudar con este tema?
muchísimas gracias!!

He probado a ver que error me da con el código que has puesto, con un sketch vacío y no he logrado que me diera error.

Supongo que se debe a que he compilador para UNO en vez de para PICO y ambos compiladores son diferentes, siendo el del UNO más "permisivo".

De todas formas creo que el archivo cabeceras.h es redundante, basta con incluir las cabeceras en el archivo menuAdmin.h y todo dentro del ifndef:

#ifndef MENUADMIN_H
#define MENUADMIN_H

#include <Arduino.h>
#include <stdint.h>
#include <stdbool.h>
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>

//#### ADMINISTRACION ####

#define PIN_CREA_TARJ_ADM   13

//#### MENU ADMINISTRACION ####

#define NRO_ITEMS_MENU_ADMIN    9

#define VER_CREDITOS_CARGADOS                 1
#define VER_CREDITOS_SIN_CARGAR               2
#define REINICIAR_CONTADOR_CREDITOS_CARGADOS  3
#define DEFINIR_CREDITOS_PARA_CARGA           4
#define VER_TARJETAS_CARGADAS                 5
#define REINICIAR_CONTADOR_TARJETAS_CARGADAS  6
#define CREAR_TARJETA_ADMINISTRACION          7
#define BORRAR_TARJETA_ADMINISTRACION         8
#define SALIR_MODO_ADMINISTRACION             9

struct MenuAdmin
{
  uint8_t nroItem;
  char LCDlinea0[16];
  char LCDlinea1[16];
} menuAdmin[NRO_ITEMS_MENU_ADMIN];

bool modoAdministracion = false;
volatile bool estINTcreaTarjAdm=false;

#endif

hola, buenas tardes,

cabeceras.h se usa en otros archivos además del ino principal,

gracias por la respuesta,

saludos,