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.

msp430f169调用子程序时,出现的函数功能重复定义的问题

Other Parts Discussed in Thread: MSP430F169

现在在学msp430f169,有一些问题需要各位大神。
在调用子程序时,经常出现函数功能重复定义。
Error[Pe247]: function "Clock_Init" has already been defined (at line 160) C:\Users\lydlove\Desktop\草稿\Config.h 160 

Error[Pe247]: function "Clock_Init_Inc" has already been defined (at line 177) C:\Users\lydlove\Desktop\草稿\Config.h 177 

Error[Pe247]: function "Clock_Init_Ex32768" has already been defined (at line 192) C:\Users\lydlove\Desktop\草稿\Config.h 192 

Error[Pe247]: function "WDT_Init" has already been defined (at line 209) C:\Users\lydlove\Desktop\草稿\Config.h 209 

如果每次写程序,都要改动Config.h,那不是很麻烦?
而且Config.h里面的东西经常被用到,很难改动!!!

  • 你好,yu lv!

    请你尝试一下,将每个头文件改为这样的格式:

    (假设头文件的文件名是:config.h)

    #ifndef _CONFIG_H_

    #define _CONFIG_H_

    ...

    /*头文件的内容*/

    ...

    #endif