Pelles C forum

C language => Beginner questions => Topic started by: heliang6291 on May 02, 2013, 05:35:48 AM

Title: How to create a head file?
Post by: heliang6291 on May 02, 2013, 05:35:48 AM
I can't create a head file in the project,
if I write a head file,how to add in my project?
Help me please,thanks.
Title: Re: How to create a head file?
Post by: czerny on May 02, 2013, 08:12:51 PM
You mean a header file?

May be your problem is, that only local header files are included in the project file list. And even the local header files are listed only if they where referenced by one or more source files.
Title: Re: How to create a head file?
Post by: heliang6291 on May 03, 2013, 03:21:54 AM
You mean a header file?

May be your problem is, that only local header files are included in the project file list. And even the local header files are listed only if they where referenced by one or more source files.

yes, a header file.
I want to write a header file,and add in my project.
Title: Re: How to create a head file?
Post by: DMac on May 03, 2013, 07:13:02 PM
In the Pelles C IDE click File>New>Source Code.

You will see a new source tab open labeled "untitled".

With this tab selected in the Pelles C IDE click File>Save as...

You will see the Save As dialog.  Select "Include file (*h) from the "Save as type" drop-down and enter a file name and save.

To  see the file in the project tree do the following:  In your C source file type #include "[filename].h" and then in the project tree right click on the project icon and select "update all dependencies".

You will now see the include file you created there.
Title: Re: How to create a head file?
Post by: heliang6291 on May 06, 2013, 06:04:56 AM
In the Pelles C IDE click File>New>Source Code.

You will see a new source tab open labeled "untitled".

With this tab selected in the Pelles C IDE click File>Save as...

You will see the Save As dialog.  Select "Include file (*h) from the "Save as type" drop-down and enter a file name and save.

To  see the file in the project tree do the following:  In your C source file type #include "[filename].h" and then in the project tree right click on the project icon and select "update all dependencies".

You will now see the include file you created there.

Thank you very much,it's OK.