교차 컴파일 오류 is not able to compile a simple test program

교차 컴파일 오류:
CMake Error at /home/sph/.local/lib/python2.7/site-packages/cmake/data/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/opt/cross-toolchain-9.2.0/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc"

  is not able to compile a simple test program.

  It fails with the following output:


해결 방법: CMAKE 와 C++ 컴파일러를 강제로 지정합니다.C_CMPILER를 CMAKE로 변경FORCE_C_COMPILER
INCLUDE(CMakeForceCompiler)

# this one is important
SET(CMAKE_SYSTEM_NAME eCos)

# specify the cross compiler
CMAKE_FORCE_C_COMPILER(arm-elf-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(arm-elf-g++ GNU)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  /home/alex/src/ecos/install )

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

좋은 웹페이지 즐겨찾기