Автор Тема: Qt Creator и cmake  (Прочитано 3692 раз)

Оффлайн kir_84

  • Начинающий
  • *
  • Сообщений: 24
Qt Creator и cmake
« : 03.03.2021 21:51:25 »
Здравствуйте!
Задана лабораторная работа на C++, выполнить которую необходимо в Qt Creator.
Qt Creator установился, однако при создании нового проекта ругается:
/home/kir/projects/untitled/CMakeLists.txt:3: ошибка: No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER
to the full path to the compiler, or to the compiler name if it is in the PATH.
Пакет cmake установлен. Как подсказать cmake где найти компилятор?
Может ли это быть связано с версией cmake (cmake_minimum_required(VERSION 3.5)), а в дистрибутиве 3.16.3?

Альт Рабочая станция 9.1

Спасибо.

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 925
    • Домашняя страница
    • Email
Re: Qt Creator и cmake
« Ответ #1 : 04.03.2021 07:05:05 »
Нет компилятора C++.
apt-get instal gcc8-c++
Андрей Черепанов (cas@)

Оффлайн kir_84

  • Начинающий
  • *
  • Сообщений: 24
Re: Qt Creator и cmake
« Ответ #2 : 04.03.2021 08:44:00 »
Установил,помогло, но не совсем  :-(

Теперь пишет
Compiler feature detection failure!
Команда «/usr/bin/g++ -x c++ -E -dM -» завершилась с кодом 1.
/usr/bin/x86_64-alt-linux-g++: No such file or directory

Compiler feature detection failure!
Команда «/usr/bin/gcc -x c -E -dM -» завершилась с кодом 1.
/usr/bin/x86_64-alt-linux-gcc: No such file or directory

Compiler feature detection failure!
Команда «/usr/bin/g++ -x c++ -E -dM -» завершилась с кодом 1.
/usr/bin/x86_64-alt-linux-g++: No such file or directory

Compiler feature detection failure!
Команда «/usr/bin/gcc -x c -E -dM -» завершилась с кодом 1.
/usr/bin/x86_64-alt-linux-gcc: No such file or directory

Работа /home/kir/Qt/Tools/CMake/bin/cmake -S /home/kir/projects/untitled -B /tmp/.private/kir/QtCreator-PATaPo/qtc-cmake-JPiTmuuT -GNinja -DCMAKE_BUILD_TYPE:String=Debug -DQT_QMAKE_EXECUTABLE:STRING=/home/kir/Qt/6.0.2/gcc_64/bin/qmake -DCMAKE_PREFIX_PATH:STRING= -DCMAKE_C_COMPILER:STRING=/home/kir/Qt/Tools/QtCreator/libexec/qtcreator/clang/bin/clang -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++-8 на /tmp/.private/kir/QtCreator-PATaPo/qtc-cmake-JPiTmuuT.
-- The CXX compiler identification is GNU 8.4.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-8 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:27 (find_package):
  Could not find a package configuration file provided by "QT" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake
    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "QT" to CMAKE_PREFIX_PATH or set "QT_DIR" to
  a directory containing one of the above files.  If "QT" provides a separate
  development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/.private/kir/QtCreator-PATaPo/qtc-cmake-JPiTmuuT/CMakeFiles/CMakeOutput.log".
Процесс CMake завершился с кодом 1.
Прошло времени: 00:00.
Работа /home/kir/Qt/Tools/CMake/bin/cmake -S /home/kir/projects/untitled -B /tmp/.private/kir/QtCreator-PATaPo/qtc-cmake-TYcStQPx -GNinja -DCMAKE_BUILD_TYPE:String=Debug -DQT_QMAKE_EXECUTABLE:STRING=/home/kir/Qt/6.0.2/gcc_64/bin/qmake -DCMAKE_PREFIX_PATH:STRING= -DCMAKE_C_COMPILER:STRING=/home/kir/Qt/Tools/QtCreator/libexec/qtcreator/clang/bin/clang -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++-8 на /tmp/.private/kir/QtCreator-PATaPo/qtc-cmake-TYcStQPx.
-- The CXX compiler identification is GNU 8.4.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-8 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:27 (find_package):
  Could not find a package configuration file provided by "QT" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake
    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "QT" to CMAKE_PREFIX_PATH or set "QT_DIR" to
  a directory containing one of the above files.  If "QT" provides a separate
  development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/.private/kir/QtCreator-PATaPo/qtc-cmake-TYcStQPx/CMakeFiles/CMakeOutput.log".
Процесс CMake завершился с кодом 1.
Прошло времени: 00:00.

Не могу понять, что ему надо?

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 925
    • Домашняя страница
    • Email
Re: Qt Creator и cmake
« Ответ #3 : 04.03.2021 09:45:20 »
gcc-common должен предоставлять g++. Qt6 ему надо. Настраивайте профили в qtcreator.
Андрей Черепанов (cas@)

Оффлайн kir_84

  • Начинающий
  • *
  • Сообщений: 24
Re: Qt Creator и cmake
« Ответ #4 : 04.03.2021 10:47:05 »
Сделал как в этой теме:
https://forum.altlinux.org/index.php?topic=43188.0

Qt creator поставил из репозитория, также поставил qt5-base-devel, изменил default на /usr/bin/qmake-qt5.

Вроде "взлетело", ошибок не выдает.
Посмотрим, как будет работать "в деле".

Спасибо.