0

I am cross-compiling a C project on a debian.

I have installed the gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf and set the PATH OK .

I add two files in my source folder :


arm_linux.bashrc :

export ARCH=arm

export CROSS_COMPILE=arm-linux-gnueabihf-


build.sh :

#!/bin/bash

set -v on

source arm_linux.bashrc

rm -r -f build

mkdir build

cd build

CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ AR=arm-linux-gnueabihf-ar LD=arm-linux-gnueabihf-ld cmake -DMAKE_TOOLCHAIN_FILE=arm-linux.cmake ..

make -j4


when I run ./build.sh

the compiling goes well,

but linking report error:


[100%]linking c executable project

/usr/bin/ld:skiping incompatible /project_path/lib/libxxx.so when searching for -lxxxlib.

/usr/bin/ld:skipping find -lxxxlib.

.....

collect2:error: ld returned 1 exit status

....


It seems that the arm-linux-gnueabihf-ld does not work, why, and how to resovlve this linking problem ?

Thanks .

cyberpunker
  • 39
  • 1
  • 1
  • 7

0 Answers0