Problem with building cmake based app using SDK

First time trying to build this minimal cmake based hello world app using lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64.tar.xz.

I followed the developer guide for using the SDK and did:

$ tar xf lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64.tar.xz
$ make menuconfig

# Select Global Build Settings and excluded the following options:
# “Select all target specific packages by default”
# “Select all kernel module packages by default”
# “Select all userspace packages by default”

# Downloaded contents of [CMakeOpenWRTExamples](https://github.com/Akagi201/CMakeOpenWRTExamples)
# into lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/package
$ ls lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/package
$ HelloCMakeApp  HelloCMakeLibMM  linux  Makefile  toolchain

$ make menuconfig
# Selected utilites --> <M> hellocmakeapp 

$ make V=s

And it fails saying -->

CMake Error at /usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/staging_dir/host/share/cmake-3.7/Modules/CMakeDetermineCCompiler.cmake:48 (message):
  Could not find compiler set in environment variable CC:

  
  /usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl/bin/ccache_cc.
Call Stack (most recent call first):
  CMakeLists.txt:6 (PROJECT)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.7)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/libhellocmakemm-0.0.1/CMakeFiles/CMakeOutput.log".
Makefile:93: recipe for target '/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/libhellocmakemm-0.0.1/.configured_yyn' failed
make[3]: *** [/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/libhellocmakemm-0.0.1/.configured_yyn] Error 1
make[3]: Leaving directory '/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/package/HelloCMakeLibMM'
package/Makefile:109: recipe for target 'package/HelloCMakeLibMM/compile' failed
make[2]: *** [package/HelloCMakeLibMM/compile] Error 2
make[2]: Leaving directory '/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64'
package/Makefile:105: recipe for target '/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/stamp/.package_compile' failed
make[1]: *** [/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64'
/usr/local/src/lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64/include/toplevel.mk:190: recipe for target 'world' failed
make: *** [world] Error 2

Am I missing something?

1 Like

A couple of problems here.
First there was some strange problem with ccache it would seem.
I tried installing/uinstalling/re-installing ccache, but it just wouldn't work. :frowning:
Solved by manually removing CONFIG_CCACHE from Config-build.in.

Then, the build failed with the linker not being able to find libuClibC++.so. This had to do with the demo package source dependencies I was using. Replaced them with stdc++, and it's working now.