I am using CMake for building the Android project. “android.toolchain.cmake” toolchain is used for building the project.
All the environment variables are set as described in the usage part of the android cmake. Following Option variables are set as environment variables ANDTOOLCHAIN ANDROID_STANDALONE_TOOLCHAIN ANDROID_ABI ANDROID_NATIVE_API ANDROID_STL CC and CXX to point to the androideabi-gcc & androideabi-g++ respectively
CMAKE is successfully generating the Make files but when I “make” the project its throwing “Error running link command: No such file or directory”.
The details of the link.txt are as under
*cd /Extra/svnroot/2014_Project/build/project123 && /usr/bin/cmake -E cmake_link_script CMakeFiles/project123dir/link.txt --verbose=1
CMAKE_C_COMPILER -fPIC -Wno-psabi --sysroot=/path_to_sysroot_dir/sysroot -fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-deprecated -Wno-unused -Wno-unused-variable -Wsign-compare -Wsequence-point -Wunused-but-set-variable -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -pthread -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-allow-shlib-undefined -Wl,--gc-sections -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libproject123.so -o ../libproject123.so CMakeFiles/project123_Sources.dir/MyAdapter.cpp.o CMakeFiles/ project123_Sources.dir /SystemInfo.cpp.o CMakeFiles/ project123_Sources.dir /ServiceControl.cpp.o CMakeFiles/ project123_Sources.dir /Wrapper.cpp.o CMakeFiles/ project123_Sources.dir /Service.cpp.o CMakeFiles/ project123_Sources.dir /MemMap.cpp.o CMakeFiles/ project123_Sources.dir.dir/Trace.cpp.o -L/path_to_ toolchain_dir/android-toolchain/bin/armeabi-v7a -L/Extra/svnroot/2014_Q4_Mobile/build
-L/path_to_thirdparty_lib/zlib-1.2.7/lib
-L/path_to_thirdparty_lib /libzip-0.11.1
-L/path_to_thirdparty_lib /boost_1_53_0/lib-android
-L/path_to_thirdparty_lib/curl-7.26.0-patch/lib -L/path_to_thirdparty_lib /fips-openssl-1.0.1g/lib /path_to_thirdparty_lib /boost_1_53_0/lib-android/libboost_date_time-gcc-mt-1_53.a /path_to_thirdparty_lib/boost_1_53_0/lib-android/libboost_filesystem-gcc-mt-1_53.a /path_to_thirdparty_lib/boost_1_53_0/lib-android/libboost_system-gcc-mt-1_53.a /path_to_thirdparty_lib /boost_1_53_0/lib-android/libboost_thread-gcc-mt-1_53.a /path_to_thirdparty_lib /boost_1_53_0/lib-android/libboost_program_options-gcc-mt-1_53.a /path_to_thirdparty_lib /boost_1_53_0/lib-android/libboost_serialization-gcc-mt-1_53.a /path_to_thirdparty_lib /curl-7.26.0-patch/lib/libcurl.a /path_to_thirdparty_lib /fips-openssl-1.0.1g/lib/libssl.a /path_to_thirdparty_lib /fips-openssl-1.0.1g/lib/libcrypto.a /path_to_thirdparty_lib /zlib-1.2.7/lib/libz.a /path_to_thirdparty_lib /libzip-0.11.1/libzip.a -ldl -lrt "/path_to_toolchain_dir/android-toolchain/arm-linux-androideabi/lib/armv7-a/thumb/libstdc++.a" "/path_to_toolchain_dir/android-toolchain/arm-linux-androideabi/lib/armv7-a/thumb/libsupc++.a"*
All files in the link.txt file are pointing to the right directory/path and there is no problem with any of the file paths. In the link.txt file instead of using the actual path to the compiler it is using CMAKE_C_COMPILER. I presume this is creating the problem since “make” command is not able to find the actual path to the compiler.
Any help in fixing this issue would be greatly appreciated.