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

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

cross mob
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi,

I would like to translate KBA224495 into Japanese.

Thanks,

Kenshow

0 Likes
1 Reply
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Original KBA: KBA224495

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

Translated by Kenshow

==============================

タイトル: PSoC Creatorでヘッダーファイルの正しい相対パスを見つける方法 - KBA224495

バージョン:**

質問:

プロジェクトのワークスペースエクスプローラーに追加されたヘッダーファイル(.h)を含めるとエラーが発生するのはなぜでしょうか?図1を参照してください。エラーメッセージは “Build error: test2.h: No such file or directoryビルドエラー:test2.h:そのようなファイルまたはディレクトリはありません)”となります。

プロジェクトでは、test1.hは[ProjectName] .cydsnフォルダーに保存され、test2.hは[ProjectName] .cydsn / testフォルダーに保存されます

1.ビルドエラー

kba224495_1.png

回答:

通常、次のコマンドを使用して、.hファイルを.cファイルに含めることができます。

              #include “[RelativePath]”

PSoC Creatorでは、各.hファイルの相対パスはヘッダーファイルプロパティリストにあります。プロパティウィンドウを開くには、ワークスペースエクスプローラーで.hファイル名を右クリックします。

図1に示されているプロジェクト用に、相対パスtest1.hは “test1.h” となり、相対パスtest2.hは “test\test2.h” となります。図2を参照してください。

図2. .hファイルの相対パス

kba224495_2.png

kba224495_3.png

図3に示すように、test2.hの相対パスを修正します。エラーは表示されなくなり、ビルドは成功します。

図3.成功したビルド

kba224495_4.png

参照ドキュメント:

PSoC® Creator™ User Guide

==============================

13-Apr-2020

Kenshow

0 Likes