How to Find the Correct Relative Path of Header Files in PSoC Creator - KBA224495
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Author: RyanZ_36 Version: **
Translation - Japanese: PSoC Creatorでヘッダーファイルの正しい相対パスを見つける方法 - KBA224495 - Community Translated (JA)
Question:
Why is there an error when I include a header file (.h) that has been added to the project Workspace Explorer? See Figure 1; the error message is “Build error: test2.h: No such file or directory”.
In the project, test1.h is saved in [ProjectName].cydsn folder and test2.h is saved in [ProjectName].cydsn/test folder.
Figure 1. Build Error
Answer: Generally .h files can be included in .c files by using the command:
#include “[RelativePath]”
In PSoC Creator, the relative path of each .h file can be found in the header file properties list. To open the Properties window, right-click the .h file name in Workspace Explorer.
For the project shown in Figure 1, the relative path of test1.h is “test1.h” and the relative path of test2.h is “test\test2.h”. See Figure 2.
Figure 2. Relative Path of .h Files
Correct the relative path of test2.h, as shown in Figure 3. The error is no longer displayed, and the build is successful.
Figure 3. Build Successful
Reference Document: