TL; DR:
Попытка скомпилировать helloworld с CMake, пользовательским набором инструментов (angstrom) и CLion.Компилятор не может запустить тест.CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY" установлен.
Здравствуйте,
новичок в Clion, стар в vim, make и c ++.
У меня есть плата µCAN от Microcontrol http://www.microcontrol.net/index.php?id=554
Далее вы можете скачать компилятор µMIC.100 ARM C / C ++ для Linux (ZIP).
- Загружен, распакован и установлен в /usr/local/angstrom../
- Установлен в UBUNTU в WindowsSubsystemforLinux
- Установлен CLION 19.1.4
- Настройка WSL Toolchain для CLION для подключения через ssh к моей WSL Ubuntu
- Пользовательские свойства CLion: idea.case.sensitive.fs = true
- Развертывание через ftp на моем µController.
Создан простой CMakeLists.txt Должен создать простой двоичный файл для запуска на цели
Не работает ...
CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
set(CMAKE_TOOLCHAIN_FILE toolchain.cmake)
SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project(helloDrive)
set(CMAKE_CXX_STANDARD 11)
add_executable(helloDrive main.cpp)
toolchain.cmake:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(tools /usr/local/angstrom/arm)
set(CMAKE_C_COMPILER ${tools}/bin/arm-angstrom-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-angstrom-linux-gnueabi-gcc)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_C_COMPILER=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -DCMAKE_CXX_COMPILER=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-cpp -D CMAKE_CXX_COMPILER=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++ -G "CodeBlocks - Unix Makefiles" /home/xyc/helloDrive
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc
-- Check for working C compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -- broken
CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/xyc/helloDrive/cmake-build-debugtoolchain/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a8ba2/fast"
/usr/bin/make -f CMakeFiles/cmTC_a8ba2.dir/build.make CMakeFiles/cmTC_a8ba2.dir/build
make[1]: Entering directory '/home/xyc/helloDrive/cmake-build-debugtoolchain/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a8ba2.dir/testCCompiler.c.o
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -o CMakeFiles/cmTC_a8ba2.dir/testCCompiler.c.o -c /home/xyc/helloDrive/cmake-build-debugtoolchain/CMakeFiles/CMakeTmp/testCCompiler.c
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc: 15: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc: Syntax error: ")" unexpected
CMakeFiles/cmTC_a8ba2.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_a8ba2.dir/testCCompiler.c.o' failed
make[1]: *** [CMakeFiles/cmTC_a8ba2.dir/testCCompiler.c.o] Error 2
make[1]: Leaving directory '/home/xyc/helloDrive/cmake-build-debugtoolchain/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_a8ba2/fast' failed
make: *** [cmTC_a8ba2/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
-- Configuring incomplete, errors occurred!
See also "/home/xyc/helloDrive/cmake-build-debugtoolchain/CMakeFiles/CMakeOutput.log".
See also "/home/xyc/helloDrive/cmake-build-debugtoolchain/CMakeFiles/CMakeError.log".
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_MAKE_PROGRAM
-- Generating done
-- Build files have been written to: /home/xyc/helloDrive/cmake-build-debugtoolchain
[Failed to reload]