To start developing an application, you create a new project. To create a new project, do the following:
- From the File menu, click New then New Project...
The New Project dialog appears. This dialog displays the set of project types and project templates.
We'll create a project to develop our application in C:
- Click the C Executable icon in the Templates pane which selects the type of project to add.
- Type Tutorial in the Name edit box, which names the project.
- You can use the Location edit box or the Browse button to locate where you want the project to be created. The default setting is fine for now.
- Click OK.
Once created, the project setup wizard prompts you to set some common options for the project.
Here you can select the target processor, whether the C double type is the same as float, and what library support to include if you use printf and scanf. You can change these settings after the project is created using the Project Explorer.
Clicking Next displays the files that will be added to the project.
The Links to system files group shows the links that will be created in the project to CrossStudio system files. Project links are fully explained in Project management, and we can ignore these for now.
The Project files group shows which files will be created in the project, and where they will be created on disk. If you uncheck an item, that file is not linked to or created in the project. We will leave all items checked for the moment and complete the project creation by clicking Finish..
The Project Explorer shows the overall structure of your project. To see the project explorer, do one of the following:
- From the View menu, click Project Explorer.
—or—
- Type Ctrl+Alt+P.
—or—
- Right click the tool bar area.
- From the popup menu, select Project Explorer.
This is what our project looks like in the Project Explorer:
You'll notice that the project name is shown in bold which indicates that it is the active project (and in our case, the only project). If you have more than one project then you can set the active project using the dropdown box on the build tool bar or the context menu of the project explorer.
The files are arranged into two groups:
- Source Files contains the main source files for your application which will typically be header files, C files, and assembly code files. You may want to add files with other extensions or documentation files in HTML format, for instance.
- System Files.contains links to source files that are not part of the project yet are required when the project is built. In this case, the system files are crt0.asm which is the C runtime startup written in assembly code, and section_placement.xml which directs the linker on how to arrange program sections in memory. Files which are stored outside of the project’s home directory are shown by a small purple shortcut indicator at the bottom left of the icon, as above.
These folders have nothing to do with directories on disk, they are simply a means to group related files together in the project explorer. You can create new folders and specify filters based on the file extension so that when you add a new file to the project it will be placed in the folder whose filter matches the file extension.