Relocations in generic elf. file in wrong format

when I try to cross compiling my test module, I met below errors: /usr/bin/ld: /tmp/tmp_gl9qpdk/lib0.o Relocations in generic EFL(EM:49) /tmp/tmp_gl9qpdk/lib0.o: error adding symbols: File in wrong format

command line:/usr/bin/c++ -shared -fPIC -o /home/ /tmp/tmp_gl9qpdk/lib0.o

The issue seems to be related with: “It can happens when you are during cross compilation if you compile something for an architecture and try linking it with some code for other architecture.”

However, I dont know how to fix it.

Anyone can help me? thanks a lot