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.

[参考译文] CCS/TM4C123GE6PM:了解为什么变量在我的 main.c 中不可见

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/738931/ccs-tm4c123ge6pm-understanding-why-a-variable-is-invisible-in-my-main-c

器件型号:TM4C123GE6PM

工具/软件:Code Composer Studio

您好!

有人建议我在此提出以下问题:

为什么当我在 .h 内声明 g_bMPU6050Done 时、问题永远不会发生  

但是、当我在.c 文件(添加到我的 CCS 项目中)中声明它时、会发生这种情况...

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

    要了解声明和定义全局变量的最佳方法、请参阅 此常见问题 解答(不是来自 TI)。  我不确定您的案例中会发生什么错误。  但我怀疑您没有在 main.c 包含的头文件中放置 g_bMPU6050Done 的声明

    谢谢、此致、

    乔治