linux編譯Android原始碼的時候出錯:error while loading shared libraries: libstdc++.so.6

童思宇發表於2018-10-08

今天在拉取Android原始碼進行編譯的時候一直報錯,在這裡記錄一下:

[  0% 1/81973] Yacc: applypatch <= bootable/recovery/edify/parser.yy
FAILED: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libedify_intermediates/parser.cpp
/bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d  --defines=out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libedify_intermediates/parser.h -o out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libedify_intermediates/parser.cpp bootable/recovery/edify/parser.yy"
prebuilts/misc/linux-x86/bison/bison: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
[  0% 6/81973] Ensuring Jack server is installed and started
Jack server already installed in "/home/tongsiyu/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/tongsiyu/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
[  0% 8/81973] target  C++: libaudioprocessing_32 <= frameworks/av/media/libaudioprocessing/AudioMixer.cpp
ninja: build stopped: subcommand failed.
16:01:48 ninja failed with: exit status 1

從官方檔案中發現有兩個包包含這個檔案 ,一個是libstdc++6 ,一個是lib32stdc++6 

解決辦法:

在終端輸入:

$sudo apt-get install libstdc++6 
$sudo apt-get install lib32stdc++6

問題終於解決。

相關文章