Go to main content
Oracle® Developer Studio 12.5: IDE Quick Start Tutorial

Exit Print View

Updated: June 2016
 
 

Adding Files to Your Project

The following sections describes how to add different types of files and folders to your current project, either by creating them or introducing existing sources.

Creating Logical Files and Folders for Your Project

You can create logical folders and add them to your project. Note that a logical folder is not stored on a disk, since it aims to organize your project files in physical view.

  1. Click the Projects tab.

  2. Right-click the project node of your CppApplication_1 project and choose New Logical Folder. A new logical folder is added to the project.

  3. Right-click the new logical folder and select Rename. Type the name you would like to give the new folder.

You can add both files and folders to an existing folder. Logical folders can be nested.

Creating New Source Files for Your Project

You can create new source files and add them to your project.

  1. Right-click the Source Files folder and choose New > C Main File.

  2. On the Name and Location page, newmain is displayed in the File Name field.

  3. Click Finish.


Note -  In this case, you do not need the main.cpp file that was added by default when you created the project.

Creating Header Files for Your Project

You can create new header files and add them to your project.

  1. Right-click the Header Files folder and choose New > C Header File.

  2. On the Name and Location page, newfile is displayed in the File Name field.

  3. Click Finish.

The newfile.h file is created on disk in the project directory and added to the Header Files folder.

Adding or Removing Existing Files to Your Project

    You can add existing files to your project in two ways:

  • Right-click the Source Files folder and choose Add Existing Item. You can point to an existing file on disk using the Select Item dialog box and add the file to the project.

  • Right-click the Source Files folder and choose Add Existing Items from Folders. Use the Add Folders dialog box to add folders that contain existing files.

Do not use the New menu item to add existing items. The Name and Location panel will tell you the file already exists.

You can also remove files from the project folders by right-clicking on the file name. Then, choose Remove From Project.