Home Download Support

C-Free - A Professional Excellent C/C++ IDE

Create and build a project

When you work on a big program, and have more than one source file, you can create a project to manage all these source files. With project, C-Free can link all your source files together to an executable file after they were compiled with no error. The following steps guide you to create, build a project, and then run it.

1. Go to the "Project" menu and choose "New...", the New Project dialog appears:

Now you can select the Project Types as "Console Application", input the Project Name as "proj1", and select "OK", then a wizard dialog appears:

In this dialog, we select Application Type as "An empty project", and click "Next". we skip second step and continue to select "Next", the following 3rd step dialog appears:

In this dialog we select Build Configuration as "mingw2.95", then click "Finish". Thus a new empty project has been created. But the project contains no file now.

2. Create two new files, input following codes to the two files:

/* a1.c */
#include<stdio.h>
int i; /* a global variable */
void func();
void main()
{
  i=3;
  printf("%d\n",i);
  i+=2;
  func();
  printf("%d\n",i);
}
/* a2.c */
#include<stdio.h>
extern int i; /* an extern variable */
void func()
{
  printf("%d\n",i);
  i++;
}

Then save these two file as "a1.c" and "a2.c" respectively. After saving file, a dialog will be displayed to ask you whether add the saved file to the current project. Please select "Yes", and then another dialog appears:

In this dialog, select the "Source Files" folder, and click "OK". Thus the saved file is added into the project. The following File Tree Window shows the state of after saving and adding two files into the project.

You also can create your own folder in the project, and add the files that you want into folder.

3. Click on the "Make and Run" button on toolbar to build this project. If there is no error, C-Free generates an executable file (proj1.exe) for the project, and automatically runs the EXE.