cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
221 Views
Registered: ‎05-24-2020

SDK Compilation error about aarch64-linux-gnu: Can't find -lgcc_s

Jump to solution

Hi there,

I got a compiling error when I try to build a C++ project. The error is shown blew:

Building target: ORBSLAM2.elf
Invoking: ARM v8 g++ linker
aarch64-linux-gnu-g++ -L../../standalone_bsp_1/psu_cortexa53_0/lib -Xlinker -sysroot=/home/jason/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu -Wl,-T -Wl,../src/lscript.ld -L/home/jason/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/lib64 -L/home/jason/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/ -o "ORBSLAM2.elf"  ./src/ORBextractor.o ./src/ORBmatcher.o ./src/converter.o ./src/frame.o ./src/frameDrawer.o ./src/initializer.o ./src/keyFrame.o ./src/keyFrameDatabase.o ./src/localMapping.o ./src/loopClosing.o ./src/main.o ./src/map.o ./src/mapDrawer.o ./src/mapPoint.o ./src/optimizer.o ./src/pnPsolver.o ./src/sim3Solver.o ./src/system.o ./src/tracking.o   -Wl,--start-group,-lxil,-lgcc,-lc,-lstdc++,--end-group,-N
/home/jason/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: Can't find -lgcc_s
makefile:48: recipe for target 'ORBSLAM2.elf' failed
/home/jason/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: Can't find -lgcc_s
collect2: error: ld returned 1 exit status
make: *** [ORBSLAM2.elf] Error 1

And I can find the libgcc_s.so file at /home/jason/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/lib64. As picture showed.

so file.png

How can I set the library or environment to avoid this problem? I have tried lots of methods such as input the path in linker(as picture shows below) but all of them didn't work for me.

setting.png

 

Could anyone please tell me how to deal this problem? Thanks in advance.

 

Best wishes.

1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
163 Views
Registered: ‎03-25-2019

Re: SDK Compilation error about aarch64-linux-gnu: Can't find -lgcc_s

Jump to solution

Hi @Jiasen,

Please add the library path under the "-L" option, found in the "Libraries" section as shown below:
lib.png
(screenshot taken from this wiki_page)

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution

View solution in original post

0 Kudos
2 Replies
Highlighted
Moderator
Moderator
164 Views
Registered: ‎03-25-2019

Re: SDK Compilation error about aarch64-linux-gnu: Can't find -lgcc_s

Jump to solution

Hi @Jiasen,

Please add the library path under the "-L" option, found in the "Libraries" section as shown below:
lib.png
(screenshot taken from this wiki_page)

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution

View solution in original post

0 Kudos
Highlighted
Visitor
Visitor
138 Views
Registered: ‎05-24-2020

Re: SDK Compilation error about aarch64-linux-gnu: Can't find -lgcc_s

Jump to solution
Hi,

Thanks for your solution and it works. Furthermore, I get a new compiling problem about 'undefined reference to __libc_init_array'. The link is https://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-failed-to-compile-with-error-of-undefined-reference-to-libc/m-p/1113386#M53764. Could you please give me any idea with that?
0 Kudos