Как установить clion на ubuntu
Yes, you can install and run CLion on Windows, macOS, and Linux.
See Install CLion for OS-specific instructions.
See CLion keyboard shortcuts for instructions on how to choose the right keymap for your operating system, and learn the most useful shortcuts.
What compilers and debuggers can I work with?
CLion supports GCC, Clang, and Microsoft Visual C++ compiler.
CLion bundles GDB and LLDB debuggers, and you can switch to a custom GDB binary (see the Debug chapter for details).
What build systems are supported? What are the project formats?
CLion fully integrates with the CMake build system: you can create, open, build and run/debug CMake projects seamlessly. CMake itself is bundled in CLion, so you don't need to install it separately unless you decide to use a custom version.
Apart from CMake, CLion supports compilation database, Gradle, and Makefile projects. Currently, you cannot create a new project of these types within CLion, but you can open and manage an existing one with full code insight available.
Refer to Project Formats for more detail.
Do I need to install anything in advance?
For C/C++ projects, CLion uses GCC/G++, Clang, or MSVC toolset.
On Windows, it means that you can select between the MinGW/ MinGW-w64 or Cygwin environment, WSL, or Visual Studio if you plan to use Microsoft Visual C++ compiler. For details, refer to Tutorial: Configure CLion on Windows.
On macOS, the required tools might be already installed. If not, update command line developer tools as described in Configuring CLion on macOS.
On Linux, compilers and make might also be pre-installed. Otherwise, in case of Debian/Ubuntu, install the build_essentials package and, if required, the llvm package to get Clang.
Are other languages besides C++ supported as well?
Yes, CLion fully supports Python, Objective-C/C++, HTML (including HTML5), CSS, JavaScript, and XML. Support for these languages is implemented via the bundled plugins, which are enabled by default. See CLion features in different languages for more details.
You can install other plugins to get more languages supported in CLion (such as Rust, Swift, or Markdown). See Valuable language plugins and explore the Plugins page in Settings / Preferences Ctrl+Alt+S .
1. Open/Create a project
Open a local project
For CMake projects, use one of the following options:
Select File | Open and locate the project directory. This directory should contain a CMakeLists.txt file.
Select File | Open and point CLion to the top-level CMakeLists.txt file, then choose Open as Project .
Select File | Open and locate the CMakeCache.txt file then choose Open as Project .
To open a compilation database project, go to File | Open , point CLion to the folder containing compile_commands.json or to the compile_commands.json file itself (then select Open as Project ).
To open a Makefile project, go to File | Open , point CLion to the folder containing the top-level Makefile or to the Makefile itself (then select Open as Project ).
To open a Gradle project, go to File | Open , point CLion to the folder containing build.gradle or to the build.gradle file itself (then select Open as Project ).
Checkout from a repository
Click Checkout from Version Control on the Welcome screen or select VCS | Checkout from Version Control from the main menu and choose your version control system.
Enter the credentials to access the storage and provide the path to the sources. CLion will clone the repository to a new CMake project.
Create a new CMake project
Select File | New Project from the main menu or click New Project on the Welcome screen.
Set the type of your project: C or C++, an executable or a library.
Note that STM32CubeMX and CUDA are also CMake-based project types.
Provide the root folder location and select the language standard.
CLion creates a new CMake project and fills in the top-level CMakeLists.txt :
The initial CMakeLists.txt file already contains several commands. Find their description and more information on working with CMake in our tutorial.
2. Take a look around
Project view shows your project files and directories. From here, you can manage project folders (mark them as sources, libraries, or excluded items), add new files, reload the project, and call for other actions such as Recompile.
Editor is where you view, write, and edit your code. The editor shows each file in a separate tab. You can also split the editor vertically or horizontally to view several tabs simultaneously.
Navigation bar helps you switch between the files' tabs, and the Toolbar provides quick access to run/debug and VSC-related actions.
Left gutter - the vertical stripe to the left of the editor - shows breakpoints and clickable icons to help you navigate through the code structure (for example, jump to a definition or declaration) and run main() or tests.
Right gutter shows the code analysis results with the overall file status indicator at the top.
Tool windows represent specific tools or tasks such as TODOs, CMake, terminal, or file structure.
Status bar shows various indicators for your project and the entire IDE: file encoding, line separator, memory usage, and others. Also, here you can find the resolve context switcher.
Any time you need to find an IDE action, press Ctrl+Shift+A or go to Help | Find Action and start typing the name of a command, setting, or even a UI element that you are looking for:
3. Customize your environment
Change the IDE appearance
The quickest way to switch between the IDE's color schemes, code styles, keymaps, viewing modes, and look-and-feels (UI themes) is the Switch. pop-up. To invoke it, click View | Quick Switch Scheme or press Ctrl+` :
To explore all the customizable options, go to the dedicated pages in Settings / Preferences Ctrl+Alt+S .
Tune the editor
Pages under the Editor node of the Settings / Preferences dialog help you adjust the editor’s behavior, from the most general settings (like Drag'n'Drop enabling and scroll configuration) to highlighting colors and code style options.
Code styles are configurable for each language separately in the pages under the Editor | Code Style node. For C/C++ , you can set one of the predefined code styles or provide your own, and configure the desired naming convention including the header guard template:
Adjust the keymap
In CLion, almost every action possible in the IDE is mapped to a keyboard shortcut. To view the default mapping, call Help | Keymap Reference .
You can customize the shortcuts in Settings / Preferences| Keymap . Use one of the predefined keymaps (Visual Studio, Emacs, Eclipse, NetBeans, Xcode, and others) and tune it as required, or create your own keymap from scratch.
There are also plugins that extend the list of available keymaps. For example, VS Code Keymap or Vim emulation (which includes the Vim keymap). Find more useful plugins for the CLion editor in Valuable non-bundled plugins.
4. Code with assistance
Auto-completion
Basic completion Ctrl+Space in CLion works as you type and gives a list of all available completions. To filter this list and see only the suggestions that match the expected type, use Smart completion Ctrl+Shift+Space :
Code generation
Even an empty class or a new C/C++ file contains boilerplate code, which CLion generates automatically. For example, when you add a new class, CLion creates a header with stub code and header guard already placed inside, and the corresponding source file that includes it.
One of the most useful code generation features is create from usage . It helps you focus on the ideas as they come up and takes care of the routine. For example, when you call a function that is not yet implemented, there is no need to break the flow: press Alt+Enter to generate stub code that you can come back to later. Create from usage works for variables and classes as well:
To get the list of code generation options at any place in your code, press Alt+Insert to invoke the Generate menu:
These options can help you skip a lot of code writing. In addition to generating constructors/destructors, getters/setters, and various operators, you can quickly override and implement functions:
Live templates are the tool to generate entire code constructs. Find the list of ready-to-use templates in Settings / Preferences | Editor | Live Templates . To paste a template in your code, call Code | Insert Live Template or press Ctrl+J , for example:
Intentions and quick-fixes
When you see a light bulb next to a symbol in your code, it means that CLion's code analysis has found a potential problem or a possible change to be made:
indicates an error and lets you choose a quick fix for it,
indicates that one or several intention actions are available.
Click the light bulb icon (or press Alt+Enter ) and choose the most suitable action or quick-fix:
Inspections
During on-the-fly code analysis, CLion highlights suspicious code and shows colored stripes in the right-hand gutter. You can hover the mouse over a stripe to view the problem description and click it to jump to the corresponding issue. The sign at the top of the gutter indicates the overall file status:
CLion detects not only compilation errors but also code inefficiencies like unused variables or dead code. Also, it integrates a customizable set of Clang-tidy checks.
To enable or disable inspections, configure their severity levels (whether an inspection should raise an error or just be shown as a warning) and set the scopes, go to Settings / Preferences | Editor | Inspections .
You can also run inspections on demand for the whole project or a custom scope, and view the results in a separate window. For this, call Code | Inspect Code or use Code | Analyze Code | Run Inspection by Name Ctrl+Alt+Shift+I for a particular inspection. From the results window, you can batch-apply quick-fixes to several issues at a time: select the issues, click the bulb button (or press Alt+Enter ) and select the resolution to be applied.
Refactorings
Refactorings help improve your code without adding new functionality, making it cleaner and easier to read and maintain. Use the Refactor menu or call Refactor This. Ctrl+Alt+Shift+T to get the list of refactorings available at the current location:
Rename Shift+F6 renames a symbol in all references;
Change Signature Ctrl+F6 adds, removes, or reorders function parameters, changes the return type, or updates the function name (affecting all usages);
Inline Ctrl+Alt+N / Extract inlines or extracts a function, typedef, variable, parameter, define, or constant;
Pull Members Up/Down ( Refactor | Pull Members Up / Push Members Down ) safely moves class members to the base or subclass.
5. Explore your code
Search everywhere
To search for anything in CLion, be it an item in your codebase, action, or UI element, press Shift twice and start typing what you are looking for in the Search Everywhere dialog. Use the filter menu to narrow your search:
Find usages
To locate the usage of any code symbol, call Find Usages ( Alt+F7 or Edit | Find | Find Usages ). You can filter the results and jump back to the source code:
Navigate in the code structure
Switch between header and source file Ctrl+Alt+Home
Go to declaration/definition Ctrl+B Ctrl+Alt+B
View type hierarchy Ctrl+H
View call hierarchy Ctrl+Alt+H
View import hierarchy Alt+Shift+H
For your code, CLion builds the hierarchies of types, call, imports, and functions. To view them, use the shortcuts given above or the commands in the Navigate menu. For example, type hierarchy helps you not only to navigate the code but also to discover what type relationships exist in the your codebase:
Also, use the left gutter icons to quickly jump to a declaration/definition or navigate through the class hierarchy (/ , / ).
View pop-up documentation
function signature details,
code documentation (either regular or Doxygen comments),
inferred types for variables declared as auto :
formatted macro expansions :
Besides, you can instantly view the definition of a symbol at caret. Press Ctrl+Shift+I to invoke the Quick Definition popup:
6. Build and run
Run/Debug configurations
For each target in a CMake or Gradle project, CLion creates a Run/Debug configuration. It is a named run/debug setup that includes target, executable, arguments to pass to the program, and other options.
Run/Debug configurations are generated from templates , such as CMake Application, Google Test, or Remote GDB Debug. The templates are customizable: when you edit a template parameter, you change the default settings of all configurations that will be created from this template later.
Edit Configurations dialog is accessible from the Run menu or the configuration switcher. Here you can manage the templates and add, delete, or edit your configurations. For example, you can customize the steps to be taken Before launch- call external tools (including the remote ones), use CMake install, or even run another configuration.
To launch your program, select the desired configuration and use commands from the Run menu or press Shift+F10 . Alternatively, invoke the Run Anything dialog by pressing Ctrl twice and start typing the configuration name: Tip: hold down Shift to switch to Debug Anything.
Build actions
Build is included in many Run/Debug configuration templates as a default pre-launch step. However, you can also perform it separately by calling the desired action from the Build menu:
Notice the Recompile option that compiles a selected file without building the whole project.
Remote and embedded development
With CLion, you can also build and run/debug on remote machines including embedded targets. Refer to Remote development and STM32CubeMX projects for details.
7. Debug
CLion integrates with the GDB backend on all platforms (on Windows, the bundled GDB is available only for MinGW) and LLDB on macOS/Linux. You can switch to a custom version of GDB on all platforms. Also, CLion provides an LLDB-based debugger for MSVC on Windows.
Currently, the versions of the bundled debuggers are the following:
LLDB v 12.0.0 for macOS/Linux and 9.0.0 for Windows (MSVC)
GDB v 10.2 for macOS
GDB v 10.2 for Windows
GDB v 10.2 for Linux
Custom GDB v 7.8.x-10.2
To start a debug session, select the desired configuration and press Shift+F9 or click . You can set breakpoints by clicking the gutter next to a code line. To follow through the execution process, use debugger's stepping actions .
In the Variables tab of the debugger tool window, you can explore the values and change them without interrupting your debug session. To evaluate an expression, click or press Alt+F8 . CLion also shows the current variables' values right in the editor, and in case you enable hex view, it is shown inlined as well:
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
2 GB of free RAM
8 GB of total system RAM
Multi-core CPU. CLion supports multithreading for different operations and processes making it faster the more CPU cores it can use.
2.5 GB and another 1 GB for caches
SSD drive with at least 5 GB of free space
Officially released 64-bit versions of the following:
Microsoft Windows 8 or later
macOS 10.13 or later
Any Linux distribution that supports Gnome, KDE, or Unity DE * .
Pre-release versions are not supported.
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)
Xcode command line developer tools (to install, use the xcode-select --install command)
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
Download the installer .exe from the Toolbox App web page.
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
Download the disk image .dmg from the Toolbox App web page.
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
Download the tarball .tar.gz from the Toolbox App web page.
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.
To run CLion, find it in the Windows Start menu or use the desktop shortcut. You can also run the launcher batch script or executable in the installation directory under bin .
Extract the archive to the desired folder.
To run CLion, use the launcher batch script or executable in the extracted directory under bin .
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:
clion.exe /S /CONFIG=d:\temp\silent.config /LOG=d:\JetBrains\CLion\install.log /D=d:\IDE\CLionSilent configuration file
The silent configuration file defines the options for installing CLion. With the default options, silent installation is performed only for the current user: mode=user . If you want to install CLion for all users, change the value of the installation mode option to mode=admin and run the installer as an administrator.
The default silent configuration file is unique for each JetBrains product. You can modify it to enable or disable various installation options as necessary.
It is possible to perform silent installation without the configuration file. In this case, omit the /CONFIG switch and run the installer as an administrator. Without the silent configuration file, the installer will ignore all additional options: it will not create desktop shortcuts, add associations, or update the PATH variable. However, it will still create a shortcut in the Start menu under JetBrains .
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 --classic option is required because the CLion snap requires full access to the system, like a traditionally packaged application.
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.
To list all installed snaps, you can run sudo snap list . For information about other snap commands, see the Snapcraft documentation.
In this article, I will show you how to install and configure CLion C/C++ IDE on Ubuntu. So, let’s get started.
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 <Enter> 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 C/C ++ IDE в Ubuntu. Итак, приступим.
Теперь нажмите Загрузить .
Теперь убедитесь, что выбран Linux . Затем нажмите ЗАГРУЗИТЬ .
Ваш браузер должен предложить вам сохранить файл. Просто выберите Сохранить файл и нажмите OK .
Как видите, загружается архив CLion.
Установка инструментов сборки C/C ++:
В этом разделе я покажу вам, как установить инструменты сборки C/C ++ на Ubuntu. Итак, мы сможем компилировать программы C/C ++ на CLion, как только мы его установим.
Сначала обновите кеш репозитория пакетов APT с помощью следующей команды:
Кэш репозитория пакетов APT должен быть обновлен.
Теперь установите инструменты разработки C/C ++ с помощью следующей команды:
Теперь нажмите y , а затем нажмите , чтобы продолжить.
C/ Должны быть установлены инструменты сборки C ++.
Установка CLion:
В этом разделе я покажу вам, как установить CLion в Ubuntu. Приступим.
Сначала перейдите в каталог
/Downloads с помощью следующей команды:
Как вы Как видите, только что скачанный мной архивный файл CLion находится здесь. Запомните имя файла.
Теперь выполните следующую команду, чтобы извлеките содержимое архива в каталог /opt .
После извлечения архива новый каталог должен быть создан внутри каталога /opt , как вы можете видеть на снимке экрана ниже. Обратите внимание на каталог имя.
Теперь запустите CLion с помощью следующей команды:
Поскольку вы впервые запускаете CLion, вам нужно будет выполнить некоторую начальную настройку. Когда вы увидите следующее окно, нажмите Не импортировать настройки и нажмите OK .
Теперь выберите либо темную тему Darcula , либо светлую тему. Затем нажмите Далее: Цепочки инструментов , как отмечено на скриншоте ниже.
Как видите, все инструменты разработки C/C ++ автоматически обнаружен. Теперь нажмите Далее: Плагины по умолчанию .
Теперь вам будет предложено настроить CLion в зависимости от того, что вы делаете. Например, если вы занимаетесь веб-разработкой вместе с C/C ++, вы можете оставить инструменты веб-разработки. Если вам это не нужно, просто нажмите Отключить все , и функции веб-разработки будут отключены.
Когда вы закончите, нажмите Далее: Рекомендуемые плагины .
Теперь убедитесь, что установлены оба флажка. Затем нажмите Начать использовать CLion , как отмечено на скриншоте ниже.
Теперь введите пароль для входа в систему и нажмите Аутентифицировать .
CLion создаст значки на рабочем столе, чтобы вы сможете запустить CLion из Меню приложений Ubuntu. Вам больше не нужно запускать его из командной строки.
Теперь вам нужно активировать CLion. CLion нельзя использовать бесплатно. Вам нужно будет купить лицензию у JetBrains, чтобы использовать CLion. Вы можете активировать CLion отсюда, если у вас есть действующая лицензия.
Если вы хотите опробовать CLion перед покупкой лицензии, выберите Оценить бесплатно и нажмите Оценить .
Должен появиться экран-заставка CLion.
Через некоторое время вы увидите панель управления CLion. Отсюда вы можете создавать, импортировать и управлять своими существующими проектами. Начальная настройка завершена.
Теперь вы можете легко запустите CLion из Меню приложений в Ubuntu .
Создание нового проекта C/C ++ с помощью CLion:
В этом разделе я покажу вам, как создать новый проект C ++ с помощью CLion и запустите свою первую программу.
Сначала запустите CLion и щелкните New Project на панели управления.
Теперь вы должны увидеть мастер создания проекта. Отсюда выберите тип проекта, который вы хотите создать. Затем выберите место в файловой системе, где вы хотите сохранить новый проект. При необходимости вы также можете выбрать стандарт языка C/C ++. По завершении нажмите Создать .
Как видите, у меня есть программа hello world на C ++ в моем каталоге проекта по умолчанию, поскольку я выбрал проект C ++ Executable .
Теперь, чтобы запустить программу, нажмите кнопку Play , как отмечено на скриншоте ниже.
Как вы Как видите, результат такой, как ожидалось. Теперь вы можете компилировать программы на C/C ++ сколько угодно.
Итак, вот как вы устанавливаете и настраиваете CLion в Ubuntu. Спасибо, что прочитали эту статью.
Читайте также: