Keil Logo

µVISION: ADDING HEADER FILES TO A PROJECT


Information in this article applies to:

  • µVision Version 2.07

QUESTION

I have created a HEADER FILES group under my TARGET folder. Then I try to add .H files to the group. However, the .H file extension is not listed as an option. What is the proper way to add header files to the project structure in µVision?

ANSWER

Add a header file to the Project window

µVision does not require you to add header files in the project structure, but you may want to add them so you can easily locate and open them for reference. Note that you can right-click on an #include  filename in your source code to open that header file.

  1. Right-click the Project group you want to add the file to and select Add Files to Group from the pop-up menu.
  2. Select All Files (*.*) from the Files of Type list.
  3. Select the header file you wish to add to the project.
  4. When prompted to select the file type, choose Text Document File.

Add a header file to a source file

In µVision5, towards the top of the source file, right-click and select Insert '#include file' and then select the file.

Some header files get called by other header files, e.g., for projects using CMSIS-compliant code, include the [device_name].h file includes many other helper header files.

If header files don't display in the project window

After successfully building a project, the header files appear under each source file. Expand each source file to see the header files.

If they do not appear, you may have disabled the option Show Include File Dependencies in the Project window.

To enable the option right click on a item in the Project Window and enable Show Include File Dependencies. After that, µVision's Find-in-Files feature will also consider the include files of your project when you search at the project level.

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Tuesday, May 1, 2018


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.