I am using a raspberry pi 4 to test the cross-compilation and run the code I compiled on a windows machine under eclipse using a cross-compiler.
When I downloaded the latest version of the cross toolchain from the ARM developer, I faced a non-compatibility between the glibc I had in my toolchain and the glibc I have in my Rasberry pi 4 board.
I tired solve this issue I tried to download the glibc 2.34 and compile it into my Rasberry pi 4 board.
I have followed this tutorial (How to build and use glibc for):
http://www.yl.is.s.u-tokyo.ac.jp/~tosh/kml/how_to_build_and_use_glibc.html
After the installation process, I have the following files in my local folder in the Rasberry pi board:
/usr/local/lib/glib-testing/lib/ld-linux-aarch64.so.1
/usr/local/lib/glib-testing/lib/libc.so.6
/usr/local/lib/glib-testing/lib/libc.so
/usr/local/lib/glib-testing/lib/libc.a
In my host machine under Windows 10 I am using eclipse.
I looked at the same example and question in the StackOverflow forum and I tried to inspire by them.
for example this question: Multiple glibc libraries on a single host have a lot of similitude but still have some issues running my application on the PI since I am compiling on Windows.
I added the following lines to my eclipse linker to pointe to the library I installed in my local folder:
-Wl,--rpath="C:\Program Files (x86)\Arm_GNU_Toolchain_aarch64-none-linux-gnu\12.2 rel1\lib" -Wl,--dynamic-linker="/usr/local/lib/glibc-testing/lib/ld-linux-aarch64.so.1"
When I run the code I have this message:
/home/pi/Bookshelf/Software/raspberyPi4TestCrossCompilation: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
I don't want to copy the files in the system because I have seen people saying taht it's dangerous and it can destroy my system. That's why I want to understand before doing bullshit.
Thank you in advance for help