Автор Тема: Сmake не находит нужный компилятор  (Прочитано 538 раз)

Оффлайн ОлегК

  • Начинающий
  • *
  • Сообщений: 17
Под ОС «Альт Рабочая станция» 10 устанавливаем CppLinuxSerial
Из инструкции по установке CppLinuxSerial:
...
1. Change into root repo directory (проблемы на стадии cmake ..):
     ```
   $ cd CppLinuxSerial
    ```
1. Create a new build directory and change into it:
     ```bash
    $ mkdir build
    $ cd build
    ```
 1. Run cmake on the parent directory to generate makefile:
     ```bash
    $ cmake ..
    ```
 1. Run make on the generated makefile to generate the static library `libCppLinuxSerial.a` and an unit test executable:
     ```bash
    $ make
    ```
 1. To install the headers on your system:
     ```bash
    $ sudo make install
    ```
 1. To run the unit tests:
     ```bash
    $ make run_unit_tests
    ```

На этапе Run cmake on the parent directory to generate makefile:  выдается сообщение об ошибке

[root@host-1 build]# cmake ..
-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler
    "/usr/bin/c++"
  is not able to compile a simple test program.
  It fails with the following output:
    Change Dir: /home/most-soi/src/CppLinuxSerial-master/build/CMakeFiles/CMakeTmp
        Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_58fdf/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_58fdf.dir/build.make CMakeFiles/cmTC_58fdf.dir/build
    gmake[1]: вход в каталог «/home/most-soi/src/CppLinuxSerial-master/build/CMakeFiles/CMakeTmp»
    Building CXX object CMakeFiles/cmTC_58fdf.dir/testCXXCompiler.cxx.o
    /usr/bin/c++    -o CMakeFiles/cmTC_58fdf.dir/testCXXCompiler.cxx.o -c /home/most-soi/src/CppLinuxSerial-master/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    /usr/bin/x86_64-alt-linux-g++: No such file or directory
    gmake[1]: *** [CMakeFiles/cmTC_58fdf.dir/build.make:78: CMakeFiles/cmTC_58fdf.dir/testCXXCompiler.cxx.o] Ошибка 1
    gmake[1]: выход из каталога «/home/most-soi/src/CppLinuxSerial-master/build/CMakeFiles/CMakeTmp»
    gmake: *** [Makefile:127: cmTC_58fdf/fast] Ошибка 2

Фрагмент /usr/bin с указанием работающего компилятора:
[most-soi@host-1 etc]$ cd /usr/bin
[most-soi@host-1 bin]$ ls -l g++*
lrwxrwxrwx 1 root root  3 дек  7  2020 g++ -> gcc
lrwxrwxrwx 1 root root 23 июл  5  2021 g++-10 -> x86_64-alt-linux-g++-10
Версия ОС
[most-soi@host-1 utils]$ uname -a
Linux host-1 5.10.195-std-def-alt1 #1 SMP Mon Sep 25 11:52:36 UTC 2023 x86_64 GNU/Linux

Прошу проконсультировать по вопросу преодоления возникающей ошибки .

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 926
    • Домашняя страница
    • Email
Установите пакет gcc-c++
Андрей Черепанов (cas@)

Оффлайн ОлегК

  • Начинающий
  • *
  • Сообщений: 17
Установите пакет gcc-c++
Получилось. Skull, особенная благодарность Вам за оперативный ответ!