Russian Qt Forum
Май 07, 2024, 22:42 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1]   Вниз
  Печать  
Автор Тема: No CMAKE_C_COMPILER could be found - Linux  (Прочитано 6332 раз)
FliXis
Гость
« : Декабрь 17, 2016, 17:02 »

Добрый день!

Система: linux mint 18.1 serena. Вышла пару дней назад.
Qt брал с оф-сайта онлайн-инстайллер qt-unified-linux-x64-2.0.4-online
Получили:
Qt Creator 4.2
Qt 5.7.1

cmake 3.5.1 из оф-репов дистра

Установил из оф-репов(некоторое из списка предустановлено системой):
gcc
g++
gdb
cmake
libfontconfig1
mesa-common-dev
build-essential
libglu1-mesa-dev -y

т.е. все, что необходимо - установлено.

Создаю самый обычный проект c++ без использования qt с cmake и получаю такую ошибку:

Код
Bash
/home/flixis/Project/Qt/Test_Project/CMakeLists.txt:3: ошибка: No CMAKE_C_COMPILER could be found. Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
:-1: ошибка: *** процесс cmake завершился с кодом 1.
 
Выполнение "/usr/bin/cmake /home/flixis/Project/Qt/Test_Project '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING= -DCMAKE_PREFIX_PATH:STRING=/home/flixis/Programs/Qt/5.7/gcc_64 -DQT_QMAKE_EXECUTABLE:STRING=/home/flixis/Programs/Qt/5.7/gcc_64/bin/qmake" в /tmp/qtc-cmake-udIXZu.
Выполнение "/usr/bin/cmake /home/flixis/Project/Qt/Test_Project '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING= -DCMAKE_PREFIX_PATH:STRING=/home/flixis/Programs/Qt/5.7/gcc_64 -DQT_QMAKE_EXECUTABLE:STRING=/home/flixis/Programs/Qt/5.7/gcc_64/bin/qmake" в /tmp/qtc-cmake-vLmdIP.
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 5.4.0
CMake Error at CMakeLists.txt:3 (project):
 No CMAKE_C_COMPILER could be found.
 
 Tell CMake where to find the compiler by setting either the environment
 variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
 the compiler, or to the compiler name if it is in the PATH.
 
 
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "/tmp/qtc-cmake-vLmdIP/CMakeFiles/CMakeOutput.log".
See also "/tmp/qtc-cmake-vLmdIP/CMakeFiles/CMakeError.log".
*** процесс cmake завершился с кодом 1.
Выполнение "/usr/bin/cmake /home/flixis/Project/Qt/Test_Project '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING= -DCMAKE_PREFIX_PATH:STRING=/home/flixis/Programs/Qt/5.7/gcc_64 -DQT_QMAKE_EXECUTABLE:STRING=/home/flixis/Programs/Qt/5.7/gcc_64/bin/qmake" в /tmp/qtc-cmake-vLmdIP.
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 5.4.0
CMake Error at CMakeLists.txt:3 (project):
 No CMAKE_C_COMPILER could be found.
 
 Tell CMake where to find the compiler by setting either the environment
 variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
 the compiler, or to the compiler name if it is in the PATH.
 
 
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "/tmp/qtc-cmake-vLmdIP/CMakeFiles/CMakeOutput.log".
See also "/tmp/qtc-cmake-vLmdIP/CMakeFiles/CMakeError.log".
*** процесс cmake завершился с кодом 1.
Выполнение "/usr/bin/cmake /home/flixis/Project/Qt/Test_Project '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING= -DCMAKE_PREFIX_PATH:STRING=/home/flixis/Programs/Qt/5.7/gcc_64 -DQT_QMAKE_EXECUTABLE:STRING=/home/flixis/Programs/Qt/5.7/gcc_64/bin/qmake" в /tmp/qtc-cmake-vLmdIP.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
 No CMAKE_C_COMPILER could be found.
 
 Tell CMake where to find the compiler by setting either the environment
 variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
 the compiler, or to the compiler name if it is in the PATH.
 
 
-- Configuring incomplete, errors occurred!
See also "/tmp/qtc-cmake-vLmdIP/CMakeFiles/CMakeOutput.log".
See also "/tmp/qtc-cmake-vLmdIP/CMakeFiles/CMakeError.log".
*** процесс cmake завершился с кодом 1.


Захожу в папку с проектом и в терминале выполняю:

Код
Bash
flixis@linux ~/Project/Qt/Test_Project $ cmake .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/flixis/Project/Qt/Test_Project
flixis@linux ~/Project/Qt/Test_Project $ make
Scanning dependencies of target Test_Project
[ 50%] Building CXX object CMakeFiles/Test_Project.dir/main.cpp.o
[100%] Linking CXX executable Test_Project
[100%] Built target Test_Project
flixis@linux ~/Project/Qt/Test_Project $


Совершенно не понимаю, в чем причина. Переустанавливал qt, не помогает.
На другом ноуте снес старое qt, и поставил свежее - там все отрабатывает нормально, но там система linux mint 18 sara.

В cmake такие переменные:
Код
Bash
CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
« Последнее редактирование: Декабрь 17, 2016, 17:28 от FliXis » Записан
FliXis
Гость
« Ответ #1 : Декабрь 17, 2016, 20:51 »

Оказалось надо было удалить CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} в конфигурации cmake в настройках креатора.
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.086 секунд. Запросов: 21.