Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

How to Find the Correct Relative Path of Header Files in PSoC Creator - KBA224495

How to Find the Correct Relative Path of Header Files in PSoC Creator - KBA224495

Community-Team
Employee
Employee
50 questions asked 10 questions asked 5 questions asked

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

pastedImage_6.png

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

pastedImage_18.pngpastedImage_17.png

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

pastedImage_29.png

Reference Document:

PSoC® Creator™ User Guide

0 Likes
1513 Views
Contributors