Undefined reference to `i2c_slave_init'

I am getting this error code when trying to compile my project:
undefined reference to `i2c_slave_init'

I have i2c_slave.h in my project:
#include <i2c_slave.h>

When I look inside i2c_slave.h I see:
void i2c_slave_init(i2c_inst_t *i2c, uint8_t address, i2c_slave_handler_t handler);

As an experiment, I commented out #include <i2c_slave.h>. When I do so I get errors for undefined references to the enums I am using which are also found in i2c_slave.h:

typedef enum i2c_slave_event_t
{
    I2C_SLAVE_RECEIVE,
    I2C_SLAVE_REQUEST,
    I2C_SLAVE_FINISH,
} i2c_slave_event_t;

So I know the linker is in fact finding i2c_slave.h or else I would receive all of these errors with i2c_slave.h included.

Any guidance would be much appreciated.

Welcome to the forum

Please post your full sketch and full error message, using code tags for both

Are you sure that you are calling the i2c_slave_init() function with the correct number and type of parameters ?

Hello and good day.

just some remarks to think on I2C:
The I2C bus can run multiple members on the bus if the ID Adress is different.
So why you need two I2C bus? Why not create two I2C instances and run them on the same bus?

https://forum.arduino.cc/t/connection-problem-two-i2c-bus-with-different-address/1152538

https://forum.arduino.cc/t/having-trouble-with-two-i2c-oleds/1198468

Best regards
Mascho11