This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320F28379D:如何正确获取 include 文件?

Guru**** 2024750 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1461864/tms320f28379d-how-to-get-the-include-file-properly

器件型号:TMS320F28379D

工具与软件:

您好!

进行 CPU2设置时出现此错误。

can.c 的路径:C:/DSP_Firmware_28379D/common/can.c

我找到了 hw_can.h 的路径:"C:\DSP_Firmware_28379D\common\F2837xD\F2837xD_common\inc\hw_can.h"

can.c 是我找到的原始文件:"C:\DSP_Firmware_28379D\common\F2837xD\F2837xD_common\driverlib\can.c"、但由于某种原因、它被移至 C:/DSP_Firmware_28379D/common/can.c.

我在这里有点困惑。 我怎样才能使它正确?  

对于这种 include "inc/hw_can.h"、如何将文件设置在正确的位置以便以这种方式使用?

谢谢!

洪美湾

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    [quote userid="267327" url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1461864/tms320f28379d-how-to-get-the-include-file-properly 我找到了 hw_can.h 的路径:"C:\DSP_Firmware_28379D\common\F2837xD\F2837xD_common\inc\hw_can.h"[quote userid="267327"url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1461864/tms320f28379d-how-to-get-the-include-file-properly 对于此类 include 文件、#include "inc/hw_can.h"、如何正确地使用此文件来放置引号[/hw_h]

    确保将以下路径添加到包含搜索路径列表(--include_path)中:

    "C:\DSP_Firmware_28379D\common\F2837xD\F2837xD_common"

    谢谢

    Ki

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Ki:

    无需将其放入 inc 文件夹"C:\DSP_Firmware_1DSP_DC_28379D\common\F2837xD\F2837xD_common\inc"?

    我两者都有。 "C:\DSP_Firmware_28379D\common\F2837xD\F2837xD_common"、

    "C:\DSP_Firmware_1DSP_DC_28379D\common\F2837xD\F2837xD_common\inc"。

    如果我将包含两个包含同一个文件的文件夹、编译器将使用哪一个?

    谢谢!

    洪美湾

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    无需将其放入 inc 文件夹、"C:\DSP_Firmware_1DSP_DC_28379D\common\F2837xD\F2837xD_common\inc"?

    对于"#include "inc/hw_can.h"、编译器需要一个可以放在"inc/hw_can.h"后面的搜索路径来查找文件。 因此:

    "C:/DSP_Firmware_28379D/common/F2837xD/F2837xD_common/"+"inc/hw_can.h"= C:/DSP_Firmware_28379D/common/F2837xD/F2837xD_common/inc/hw_can.h"

    如果我包含两个包含同一文件的文件夹、编译器将使用哪一个?

    它将按列出的路径的顺序进行搜索、直到 首次找到该文件。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    非常感谢。 你帮我很多! 祝您度过美好的一天!