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/MSP430G2553:使用库时有关声明的内爆性函数的警告

Guru**** 2559750 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/829776/ccs-msp430g2553-warning-about-implicity-declared-function-when-using-libraries

器件型号:MSP430G2553

工具/软件:Code Composer Studio

大家好、

为了使我的代码更易读/移植、我将许多函数移动到了单独的库文件中。   但是、现在当我编译主工程时、我会收到有关的警告   

#225-D:函数" "隐式声明  


是否有人对此有很好的补救措施?  我希望避免在 main.c 文件中声明函数。

谢谢!   

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

    对于您移动到"mumble.c"的每个函数、请在"mumble.h"中添加一个声明。

    只需复制每个函数原型、在末尾添加"extern "和";"即可 它非常快。

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

    … 然后不要忘记#include "mumble.h"

    谢谢、祝您愉快

       Johann

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

    谢谢!  我会尝试一下。