Tencent / mars

Mars is a cross-platform network component developed by WeChat.
Other
17.32k stars 3.63k forks source link

ubuntu19.04下无法编译 #718

Open amoikevin opened 5 years ago

amoikevin commented 5 years ago

系统: Ubuntu 19.04 Desktop NDK: r16b mars: v1.2.3

错误 ndk path:/home/jkl/WorkSpace/Android/ndk-r16b/ [[==BUILD_DESCRIPTION==]]Revision: b8efce07                   

PublicComponent
KEYVALUE
Branchmaster
BuildTag
BuildTime2019-11-08 23:56:32
Revisionb8efce07
build cmd:cmake "/home/jkl/mars/mars" -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/home/jkl/WorkSpace/Android/ndk-r16b//build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN=clang -DANDROID_NDK=/home/jkl/WorkSpace/Android/ndk-r16b/ -DANDROID_PLATFORM=android-14 -DANDROID_STL="c++_shared" && cmake --build . --target marsxlog --config Release -- -j8 -- CMAKE_INSTALL_PREFIX=/home/jkl/mars/mars/cmake_build/Android -- CMAKE_INSTALL_PREFIX=/home/jkl/mars/mars/cmake_build/Android CMake Warning at /home/jkl/WorkSpace/Android/ndk-r16b/build/cmake/android.toolchain.cmake:63 (message): Using custom NDK path (ANDROID_NDK is set): /home/jkl/WorkSpace/Android/ndk-r16b/ Call Stack (most recent call first): /usr/share/cmake-3.13/Modules/CMakeDetermineSystem.cmake:94 (include) comm/CMakeLists.txt:6 (project)

-- Check for working C compiler: /home/jkl/WorkSpace/Android/ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- Check for working C compiler: /home/jkl/WorkSpace/Android/ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- broken CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler

"/home/jkl/WorkSpace/Android/ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/jkl/mars/mars/cmake_build/Android/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_3fe76/fast"
/usr/bin/make -f CMakeFiles/cmTC_3fe76.dir/build.make CMakeFiles/cmTC_3fe76.dir/build
make[1]: 进入目录“/home/jkl/mars/mars/cmake_build/Android/CMakeFiles/CMakeTmp”
Building C object CMakeFiles/cmTC_3fe76.dir/testCCompiler.c.o
/home/jkl/WorkSpace/Android/ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=armv7-none-linux-androideabi --gcc-toolchain=/home/jkl/WorkSpace/Android/ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/jkl/WorkSpace/Android/ndk-r16b/sysroot   -isystem /home/jkl/WorkSpace/Android/ndk-r16b/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security     -o CMakeFiles/cmTC_3fe76.dir/testCCompiler.c.o   -c /home/jkl/mars/mars/cmake_build/Android/CMakeFiles/CMakeTmp/testCCompiler.c
/home/jkl/WorkSpace/Android/ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
make[1]: *** [CMakeFiles/cmTC_3fe76.dir/build.make:66:CMakeFiles/cmTC_3fe76.dir/testCCompiler.c.o] 错误 127
make[1]: 离开目录“/home/jkl/mars/mars/cmake_build/Android/CMakeFiles/CMakeTmp”
make: *** [Makefile:121:cmTC_3fe76/fast] 错误 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): comm/CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred! See also "/home/jkl/mars/mars/cmake_build/Android/CMakeFiles/CMakeOutput.log". See also "/home/jkl/mars/mars/cmake_build/Android/CMakeFiles/CMakeError.log". !!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!

garryyan commented 5 years ago

error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

处理掉这个错误

SheepYang1993 commented 4 years ago

1.sudo apt install apt-file 2.sudo apt-file update 3.sudo apt-file find libncurses.so.5 4.sudo apt install libncurses5