Cross compiling a C++ code with RabbitMQ

Hello, I need to cross compile a C++ code which includes RabbitMQ C++ library called SimpleAmqpClient with mips-openwrt-linux-g++ cross compiler on an Ubuntu 20.04 machine. I've tried giving this toolchain to Eclipse's C++ IDE and compile with -lSimpleAmqpClient flags and respective include path but cross compiler's ld skips SimpleAmqpClient library due to incompatibilty.

I saw people saying that external libraries need to be compiled with that cross compiler too but even a helloworld example uses #include <iostream> and RabbitMQ works same way with using #include <SimpleAmqpClient/SimpleAmqpClient.h>. So why is it need to be compiled with cross compiler or if it is not what should I do to use this library with a cross compiler.

I tried to change the CmakeList in that library to make Cmake use that cross compiler at build process but I couldn't achieve anything. I'm a beginner on these topics so I appreciate any help. The library is