Creating a C/C++ Project
You can create four types of C/C++ projects in MindStudio: C Executable, C Library, C++ Executable, and C++ Library. Methods of creating these projects are similar. The following example describes how to create a C++ Executable project.
- Only C/C++ projects of the CMake compilation framework can be created.
- The C standard covers C90, C99, and C11. The C++ standard covers C++98, C++11, C++14, C++17, and C++20
- A library project can be static or shared.
- MindStudio supports keyword colorization and redirection for .c, .cpp, .cc, and .h source files.
Creating a C/C++ Project
- Navigate to the project creation window.
- On the MindStudio welcome page, click New Project.
- On the MindStudio project page, choose from the top menu bar.
- In the New Project window, select C++ Executable. In the right pane, select Language standard (language range supported by the C++ standard. The default value is C++ 98). Click Next.
- Access the project configuration page and set project parameters listed in Table 1.
Table 1 Project parameters Parameter
Description
Project name
Project name (user-defined).
The name contains a maximum of 64 characters and must start and end with a digit or letter. Only letters, digits, hyphens (-), and underscores (_) are allowed.
Project location
Default path for saving a project (user-defined). (For users who use MindStudio for the first time, the default value is $HOME/MindstudioProjects)
More Settings
Module name: module name, same as the Project name.
Content root: path in the root directory.
Module file location: module file path.
Click the check box on the right of Project format. A drop-down list is displayed.- .idea (directory-based) (default option): During project creation, an .idea option is created to save the project information.
- .ipr (file-based): project configuration file used to save the project configuration information.
- Click Finish.
If there is already an active project in the window, a confirmation message is displayed.
- Click This Window to open the newly created project in the current window.
- Click New Window to open the newly created project in a new window.
- After the project is created, find the project directory displayed in a tree structure (subject to the actual creation result).
Importing a C/C++ Project
- Import the project file.
- On the MindStudio welcome page, click Open, select the project to be imported, and click OK.
- On the MindStudio project page, choose from the top menu bar or click
on the menu bar to select an existing project and open it.
If a project has code risks, the trust window is displayed when you open the project.
- If the project source code is trusted and secure, click Trust Project. (You can select Trust projects in <workspace_directory> to trust all projects in the directory.)
- If the project is not trusted and you only want to view the source code, click Preview in Safe Mode to preview the project in safe mode.
- To cancel opening the project, click Don't Open.
- If there is already an active project in the window, a confirmation message is displayed.
- Click This Window to open the project in the current window.
- Click New Window to open the project in a new window.
- After the project is imported, find the project directory displayed in a tree structure (subject to the actual creation result).