Creating a C/C++ Project
You can create four types of C/C++ projects in MindStudio IDE: 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 IDE 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 IDE welcome page, choose Projects from the left menu and click New Project on the right.
Figure 1 Project creation page
- On the MindStudio IDE project page, click
in the upper left corner of the project page. On the menu bar, choose
- On the MindStudio IDE welcome page, choose Projects from the left menu and click New Project on the right.
- In the New Project window, select C++ Executable from the left menu, and select Language standard (language range supported by the C++ standard. The default value is C++ 98) in the right pane. Click Next.Figure 2 Selecting C++ Executable
- 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 IDE for the first time, the default value is $HOME/MindstudioProjects)
More Settings
Module name: module name, the 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 Create. A project is created.
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.
Importing a C/C++ Project
- Import the project file.
- On the MindStudio IDE welcome page, click Open, select the project to be imported, and click OK.
- In the upper left corner of the MindStudio IDE project page, click the
menu bar, choose from the top menu bar or click
on the toolbar, and select an existing project to 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.