как установить компилятор на clion linux
Как настроить Clion для компиляции и запуска
Я просто скачать Clion от https://www.jetbrains.com/ потому что я просто обожаю всю их продукцию.
однако у меня возникли проблемы с его правильной конфигурацией, отбросьте тот факт, что я пытаюсь, я не могу скомпилировать и запустить свое приложение (простой hello world one )
когда я пытаюсь запустить приложение, оно ссылается на «Редактировать конфигурацию», поэтому я добавил новое приложение и теперь проблема.
конфигурация Rest, похоже, не требуется.
Мой CMakeList.тхт выглядит так:
Я пытаюсь выполнить это с «все цели», а также попытаться setupt выполнимый. Все, но я не могу заставить его работать.
здесь кто-нибудь, у кого были эти проблемы раньше и может посоветовать? Спасибо
3 ответов
я столкнулся с такой же проблемой с CLion 1.2.1 (на момент написания этого ответа) после обновления Windows 10. Он работал нормально, прежде чем я обновил свою ОС. Моя ОС установлена на диске C:\, а CLion 1.2.1 и Cygwin (64-бит) установлены на диске D:\.
проблема, похоже, связана с CMake. Я использую Cygwin. Ниже приведен краткий ответ с шагами, которые я использовал для устранения проблемы.
КОРОТКИЙ ОТВЕТ: (должно быть похоже на MinGW тоже, но я не пробовал это):
ОТВЕТ:
Ниже приведены подробные шаги, которые решили эту проблему для меня:
удалить / удалить предыдущую версию Cygwin (MinGW в вашем дело)
убедитесь, что CLion обновлен
запустите Cygwin setup (x64 для моей 64-разрядной ОС)
установите по крайней мере следующие пакеты для Cygwin: gcc g++ make Cmake gdb Убедитесь, что вы устанавливаете правильные версии вышеуказанных пакетов, которые требуются CLion. Вы можете найти необходимые номера версий в разделе быстрого запуска CLion (я не могу опубликовать более 2 ссылок, пока у меня не будет больше репутации точки.)
затем вам нужно добавить Cygwin (или MinGW) в переменную среды Windows с именем ‘Path’. Вы можете Google, как найти переменные среды для вашей версии Windows
добавить папка » bin » для переменной Path. Для Cygwin я добавил: D:\cygwin64\bin
выберите ‘Сборка, Выполнение, Развертывание’ а затем нажмите на кнопку ‘Toolchains’
код ‘среда’ должен показывать правильный путь в каталог установки Cygwin (или MinGW)
на ‘CMake исполняемый файл’ выберите ‘используйте комплект CMake x.X. x’ (3.3.2 в моем случае на момент написания этого ответа)
‘Debugger’ показали мне говорит ‘Cygwin GDB GNU gdb (GDB) 7.8’ [слишком много gdb в этой строке ;-)]
ниже есть галочка для всех категорий и также должен отображаться правильный путь к ‘make’, ‘C compiler’ и ‘компилятор C++’
создайте свой проект, а затем запустите проект. Вы должны увидеть в окне терминала
надеюсь, что это помогает! Удачи и наслаждайтесь CLion.
Я встретил некоторые проблемы в Clion и, наконец, я решил их. Вот некоторый опыт.
вы также можете использовать компилятор Microsoft Visual Studio вместо Cygwin или MinGW в среде Windows в качестве компилятора для CLion.
просто перейдите, чтобы найти действия в справке и введите «реестр» без » и включите CLion.включить.индекса MSVC Теперь настройте toolchain с помощью компилятора Microsoft Visual Studio. (Вам нужно скачать его, если он еще не загружен)
Install CLion
CLion is a cross-platform IDE that provides consistent experience on Windows, macOS, and Linux (for setup on FreeBSD, refer to this instruction).
System requirements
Requirement | Minimum | Recommended |
---|---|---|
RAM | 2 GB of free RAM | 8 GB of total system RAM |
CPU | Any modern CPU | Multi-core CPU. CLion supports multithreading for different operations and processes making it faster the more CPU cores it can use. |
Disk space | 2.5 GB and another 1 GB for caches | SSD drive with at least 5 GB of free space |
Monitor resolution | 1024×768 | 1920×1080 |
Operating system | Latest 64-bit version of Windows, macOS, or Linux (for example, Debian, Ubuntu, or RHEL) |
* CLion is not available for some Linux distributions, such as RHEL6/CentOS6, which do not include glibc version 2.14 required by JBR 11.
You do not need to install Java to run CLion because JetBrains Runtime is bundled with the IDE (based on JRE 11).
Toolchain requirements
In case of using MSVC compiler: Visual Studio 2013, 2015, 2017, or 2019
In case of using WSL: Windows 10 Fall Creators Update (least version 1709, build 16299.15)
In case of using custom CMake: version 2.8.11 or later
In case of using custom GDB: version 7.8.x-10.2 or later
Install using the Toolbox App
The JetBrains Toolbox App is the recommended tool to install JetBrains products. Use it to install and manage different products or several versions of the same product, including Early Access Program (EAP) and Nightly releases, update and roll back when necessary, and easily remove any tool. The Toolbox App maintains a list of all your projects to quickly open any project in the right IDE and version.
Install the Toolbox App
Run the installer and follow the wizard steps.
After you run the Toolbox App, click its icon in the notification area and select which product and version you want to install.
Log in to your JetBrains Account from the Toolbox App and it will automatically activate the available licenses for any IDE that you install.
Install the Toolbox App
There are separate disk images for Intel and Apple Silicon processors.
Mount the image and drag the JetBrains Toolbox app to the Applications folder.
After you run the Toolbox App, click its icon in the main menu and select which product and version you want to install.
Log in to your JetBrains Account from the Toolbox App and it will automatically activate the available licenses for any IDE that you install.
Install the Toolbox App
Extract the tarball to a directory that supports file execution.
For example, if the downloaded version is 1.17.7391, you can extract it to the recommended /opt directory using the following command:
Execute the jetbrains-toolbox binary from the extracted directory to run the Toolbox App and select which product and version you want to install. After you run the Toolbox App for the first time, it will automatically add the Toolbox App icon to the main menu.
Log in to your JetBrains Account from the Toolbox App and it will automatically activate the available licenses for any IDE that you install.
You can use this shell script that automatically downloads the tarball with the latest version of the Toolbox App, extracts it to the recommended /opt directory, and creates a symbolic link in the /usr/local/bin directory.
Standalone installation
You can install CLion manually and have the option to manage the location of every instance and all the configuration files. This is useful, for example, if you have a policy that requires specific install locations.
Run the installer and follow the wizard steps.
On the Installation Options step, you can configure the following:
Create a desktop shortcut for launching CLion.
Add the directory with CLion command-line launchers to the PATH environment variable to be able to run them from any working directory in the Command Prompt.
Add the Open Folder as Project action to the system context menu (when you right-click a folder).
Associate specific file extensions with CLion to open them with a double-click.
Extract the archive to the desired folder.
There are separate disk images for Intel and Apple Silicon processors.
Mount the image and drag the CLion app to the Applications folder.
Run the CLion app from the Applications directory, Launchpad, or Spotlight.
Unpack the downloaded CLion-*.tar.gz archive. The recommended extract directory is /opt :
Do not extract the tarball over an existing installation to avoid conflicts. Always extract to a clean directory.
Execute the CLion.sh from bin subdirectory to run CLion:
To create a desktop entry, do one of the following:
On the Welcome screen, click Configure | Create Desktop Entry
From the main menu, click Tools | Create Desktop Entry
When you run CLion for the first time, some steps are required to complete the installation, customize your instance, and start working with the IDE.
Silent installation on Windows
Silent installation is performed without any user interface. It can be used by network administrators to install CLion on a number of machines and avoid interrupting other users.
To perform silent install, run the installer with the following switches:
/S : Enable silent install
/CONFIG : Specify the path to the silent configuration file
/D : Specify the path to the installation directory
This parameter must be the last in the command line and it should not contain any quotes even if the path contains blank spaces.
To check for issues during the installation process, add the /LOG switch with the log file path and name between the /S and /D parameters. The installer will generate the specified log file. For example:
Silent configuration file
You can download the default silent configuration file for CLion at https://download.jetbrains.com/cpp/silent.config
The default silent configuration file is unique for each JetBrains product. You can modify it to enable or disable various installation options as necessary.
Install as a snap package on Linux
You can install CLion as a self-contained snap package. Since snaps update automatically, your CLion installation will always be up to date.
To use snaps, install and run the snapd service as described in the installation guide.
On Ubuntu 16.04 LTS and later, this service is pre-installed.
CLion is distributed via two channels:
The stable channel includes only stable versions. To install the latest stable release of CLion, run the following command:
The edge channel includes EAP builds. To install the latest EAP build of CLion, run the following command:
When the snap is installed, you can launch it by running the clion.sh command.
How to Install Jetbrains CLion on Ubuntu
In this article, I will show you how to install and configure CLion C/C++ IDE on Ubuntu. So, let’s get started.
Downloading CLion:
To download CLion, visit the official website of JetBrains at https://www.jetbrains.com from your favorite web browser and go to Tools > CLion.
Now, click on Download.
Now, make sure Linux is selected. Then, click on DOWNLOAD.
Your browser should prompt you to save the file. Just select Save File and click on OK.
As you can see, the CLion archive is being downloaded.
Installing C/C++ Build Tools:
In this section, I will show you how to install C/C++ build tools on Ubuntu. So, we will be able to compile C/C++ programs on CLion once we get it installed.
First, update the APT package repository cache with the following command:
The APT package repository cache should be updated.
Now, install C/C++ development tools with the following command:
Now, press y and then press to continue.
C/C++ build tools should be installed.
Installing CLion:
In this section, I will show you how to install CLion on Ubuntu. Let’s get started.
First, navigate to the
/Downloads directory with the following command:
As you can see, the CLion archive file I just downloaded is here. Remember the filename.
Now, run the following command to extract the contents of the archive to the /opt directory.
Once the archive is extracted, a new directory should be created inside the /opt directory as you can see in the screenshot below. Note the directory name.
Now, run CLion with the following command:
As you’re running CLion for the first time, you will have to do some initial configuration. Once you see the following window, click on Do not import settings and click on OK.
Now, select either the Dark theme Darcula or the Light theme. Then, click on Next: Toolchains as marked in the screenshot below.
As you can see, all the C/C++ development tools are automatically detected. Now, click on Next: Default plugins.
Now, you will be asked to tune CLion depending on what you do. For example, if you do web development along with C/C++, then you can keep the Web Development tools. If you don’t need it, just click on Disable All, and web development functionalities will be disabled.
Once you’re done, click on Next: Featured plugins.
Now, CLion will suggest you some popular plugins that you can install to add more functionalities to CLion. For example, if you work with GitHub, then the Markdown plugin is very important for you. So, you can click on Install to install it as CLion plugin. Once you’re done, click on Next: Desktop Entry.
Now, make sure both of the checkboxes are checked. Then, click on Start using CLion as marked in the screenshot below.
Now, type in your login user’s password and click on Authenticate.
CLion will create desktop icons so that you will be able to launch CLion from the Application Menu of Ubuntu. You don’t have to start it from the command line ever again.
Now, you have to activate CLion. CLion is not free to use. You will have to buy a license from JetBrains in order to use CLion. You can activate CLion from here if you have valid license.
If you want to try out CLion before you buy the license, then select Evaluate for free and click on Evaluate.
CLion splash screen should show up.
After a while, you will see the CLion dashboard. From here, you can create, import and manage your existing projects. The initial configuration is complete.
Now, you can easily start CLion from the Application Menu of Ubuntu.
Creating a New C/C++ Project with CLion:
In this section, I will show you how to create a new C++ project with CLion and run your first program.
First, start CLion and click on New Project from the dashboard.
Now, you should see the project creation wizard. From here, select what type of project you want to create. Then, select a location on your filesystem where you want to save the new project. You can also select the C/C++ language standard if you need to. Once you’re done, click on Create.
As you can see, I have a hello world C++ program in my project directory by default as I selected C++ Executable project.
Now, to run the program, click on the Play button as marked in the screenshot below.
As you can see, the output is as expected. You can now compile C/C++ programs as much as you want.
So, that’s how you install and configure CLion on Ubuntu. Thanks for reading this article.
Как настроить CLion актуальной версии для запуска и компиляции
CLion — это относительно новая IDE разработки и отладки кода на C/C++. Она основана на популярной платформе Intellij и наследует от нее большинство полезных функций, таких как:
Обзор IDE C L ion
При кодировании C L ion позволяет ва м вообще забыть о рутине. Компилятор и отладка кода в C L ion просто на высоте. Вы можете четко сконцентрироваться только на важном, а все остальное этот редактор возьмет на себя. Данная IDE способна повысить в ашу производительность за счет «умного» и своевременного автозавершения кода, мгновенной навигации по документу и надежного рефакторинга.
Преимущества C L ion перед другими IDE
Как настроить IDE CLion?
Запуск и отладка CLion
В зависимости от цели вашего проекта (CMake, Makefile, Gradle) CLion будет генерировать необходимую конфигурацию, которую можно будет запустить.
Запуск CLion
Условно весь запуск можно поделить на несколько частей :
Отладка CLion
CLion интегрируется с серверной частью GDB на всех платформах и с LLDB на macOS и Linux. Условно процесс отладки можно разделить на несколько частей:
CLion — это достаточно умная среда разработки. Функциональность всей IDE не уместить в одну статью, поэтому ее нужно пробовать. Настроить C L ion просто, отладка происходит интуитивно, компилятор работает безупречно, общая функциональность этой IDEшки впечатляет. Что еще нужно для успешной разработки?
Мы будем очень благодарны
если под понравившемся материалом Вы нажмёте одну из кнопок социальных сетей и поделитесь с друзьями.
Как установить JetBrains CLion в Linux
от sasza
JetBrains Clion — это кроссплатформенная IDE (интегрированная среда разработки) для языков программирования C и C ++. Он предлагает множество ценных функций, таких как генерация кода, анализ кода и т. Д.
Установка пакета Snap
JetBrains CLion доступен в виде пакета Snap для тех, кто любит использовать Ubuntu Snap Store. Чтобы использовать CLion в качестве Snap, у вас должна быть настроена и установлена среда выполнения Snapd в вашей системе Linux.
Если вы используете Ubuntu, среда выполнения Snapd уже готова к работе. Однако, если вы используете Fedora, OpenSUSE, Arch Linux или что-то еще, вам необходимо заранее установить среду выполнения.
Настроить среду выполнения Snapd в Linux, чтобы вы могли устанавливать пакеты Snap, относительно просто. Для начала установите пакет «snapd» с помощью диспетчера пакетов вашей ОС Linux. После этого используйте Systemd, чтобы включить файл «snapd.socket».
Не можете понять, как настроить среду выполнения Snapd на вашем ПК с Linux? Это нормально! Мы можем помочь! Следуйте нашему подробному руководству о том, как настроить пакеты Snap, чтобы заставить его работать.
После настройки Snaps вы сможете быстро установить приложение JetBrains CLion на свой компьютер с Linux с помощью следующей команды мгновенной установки ниже.
Имейте в виду, что CLion устанавливается как Snap в «Классическом режиме». Для классического режима требуется AppArmor, и не каждая операционная система Linux поддерживает его. Если Snap сообщает вам, что вы не можете установить его правильно, попробуйте вместо этого инструкции по установке Flatpak.
Установка Flatpak
JetBrains CLion доступен как Flatpak в магазине приложений Flathub. Если вы хотите установить эту программу как Flatpak в вашей ОС Linux, вам сначала необходимо настроить среду выполнения Flatpak.
Настроить среду выполнения Flatpak в Linux очень просто. Для этого вам нужно только установить пакет «flatpak» в вашу систему с помощью менеджера пакетов. Если вам нужна помощь в настройке Flatpak на вашем ПК с Linux, следуйте нашему руководству по этому вопросу.
После того, как среда выполнения Flatpak запущена, следующим шагом будет включение магазина приложений Flathub. Flathub содержит пакет JetBrains CLion, поэтому этот шаг очень важен. Чтобы включить Flathub, используйте следующую команду удаленного добавления flatpak ниже.
Настроив магазин приложений Flathub, вы сможете установить CLion на свой компьютер с Linux. Используя приведенную ниже команду установки flatpak, заставьте приложение работать на вашем компьютере.
Установка Arch Linux
Как и все приложения JetBrains, для CLion доступен для установки пакет AUR. Имейте в виду, что эти пакеты, хотя и хороши, не получают официальной поддержки от JetBrains. Тем не менее, пакет CLion AUR загружается непосредственно с их веб-сайта, поэтому он не использует какой-либо модифицированный код.
Чтобы начать установку CLion в Arch Linux, вам необходимо установить пакеты «Git» и «Base-devel». Эти пакеты необходимы для взаимодействия с AUR.
После установки двух пакетов вы должны установить помощник Trizen AUR. Эта программа автоматизирует установку CLion, поэтому вам не придется делать все вручную.
Чтобы установить Trizen, последовательно введите следующие команды.
Стандартная установка Linux
JetBrains CLion поставляется с универсальным установщиком для тех, кто в Linux не хочет использовать Snaps или Flatpak и не использует Arch Linux. Чтобы начать установку, перейдите на страницу загрузки CLion и нажмите синюю кнопку «Загрузить».
После загрузки используйте команду CD, чтобы переместить окно терминала в каталог «Загрузки». Затем с помощью команды tar распакуйте ранее загруженный файл JetBrains CLion TarGZ.
Внутри каталога «Downloads» используйте команду tar xvf, чтобы распаковать файл CLion TarGZ. Процесс распаковки должен занять всего пару секунд, так как файл не такой большой.
Когда процесс будет завершен, используйте команду CD, чтобы перейти в новую папку CLion, созданную командой tar после процесса распаковки.