Creating a C or C++ source file
Once you have created a new remote C/C++ project, you can begin populating it with your source code. The following section describes how to create a
.c or .cpp file and save it in the remote project that you created. It also describes how to import existing files from your local file system.
Creating a C or C++ File
To create a C or C++ file:
- In the Project Explorer view, right-click your remote project, and select New > Source File.
- Using the pulldown on the Template field, select either the C or C++ template.
- In the Source File field, type the name of the file to be created including the appropriate extension.
- Click Finish. The file will automatically open in the Remote C/C++ editor.
- Enter your code in the editor and save the file.
Your new source file is displayed in the Project Explorer view. Before you can build your remote C/C++ project, you must create a makefile.
See Creating a makefile.
Importing an existing C or C++ file from your local file system
To import an existing C or C++ file from your local file system:
- In the Project Explorer view, right-click your remote project, and select Import.
- Select General > File System.
- Click Next.
- Locate and select your C or C++ source file(s) and click Finish.
Your new source file is displayed in the Project Explorer view. Before you can build your remote C/C++ project, you must create a makefile.
See Creating a makefile.
Related tasks
Create remote connection
Create a Local/Remote C/C++ Project
Creating a makefile
Building a C/C++ project
Editing a C or C++ file
© Copyright IBM Corporation 2009, 2010. All Rights Reserved.