TI中文支持网
TI专业的中文技术问题搜集分享网站

ccs9.1添加头文件问题

当我在使用ccs9.1添加头文件时总是出现各种各样的问题,例如在创建一个名为LCDTEST新工程时,为它中添加 OutOfBox_MSP430FR6989例程中的hal_LCD.c与hal_LCD.h时编译总会出现各种问题,但如果把main.c中的代码放到 OutOfBox_MSP430FR6989例程当中就不会出现问题。我想要知道应该如何为一个新工程添加头文件,我已经尝试过http://processors.wiki.ti.com/index.php/Include_paths_and_options中的方法,仍然行不通,请尽可能完整的演示一下应该如何为一个新工厂添加头文件,谢谢

Susan Yang:

根据您的描述,应该还是路径的问题。我会实验一下后给您回复

user6003002:

回复 Susan Yang:

感谢您的回答,但我仍然行不通,以下为错误信息**** Build of configuration Debug for project 6989 ****

"D:\\ti\\ccs\\utils\\bin\\gmake" -k -j 8 all -O Building file: "C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c"Invoking: MSP430 Compiler"D:/ti/ccs/tools/compiler/ti-cgt-msp430_18.12.2.LTS/bin/cl430" -vmspx –data_model=restricted –use_hw_mpy=F5 –include_path="D:/ti/ccs/ccs_base/msp430/include" –include_path="D:/ti/msp430_driverlib_2_91_11_01/driverlib/MSP430FR5xx_6xx" –include_path="C:/Users/ewang/Desktop/program/tiworkspace/6989" –include_path="C:/Users/ewang/Desktop/driver of r6989/lcd" –include_path="D:/ti/ccs/tools/compiler/ti-cgt-msp430_18.12.2.LTS/include" –advice:power=all –advice:hw_config=all –define=__MSP430FR6989__ –define=_MPU_ENABLE -g –printf_support=minimal –diag_warning=225 –diag_wrap=off –display_error_number –silicon_errata=CPU21 –silicon_errata=CPU22 –silicon_errata=CPU40 –preproc_with_compile –preproc_dependency="driver of hal_LCD.d_raw" "C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c" >> Compilation failuresubdir_rules.mk:9: recipe for target 'hal_LCD.obj' failed"C:\Users\ewang\Desktop\driver of r6989\lcd\hal_LCD.h", line 44: warning #41-D: expected an identifier"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 99: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 100: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 101: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 102: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 103: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 146: error #20: identifier "mode" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 165: warning #225-D: function "showChar" declared implicitly"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 165: error #20: identifier "pos1" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 166: error #20: identifier "pos2" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 167: error #20: identifier "pos3" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 168: error #20: identifier "pos4" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 169: error #20: identifier "pos5" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 170: error #20: identifier "pos6" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 150: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 155: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 156: remark #2553-D: (ULP 14.1) Array index (involving "t") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 158: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #1545-D: (ULP 14.1) Array index of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #2553-D: (ULP 14.1) Array index (involving "j") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 172: remark #1527-D: (ULP 2.1) Detected SW delay loop using __delay_cycles. Recommend using a timer module instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 155: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 156: remark #2553-D: (ULP 14.1) Array index (involving "t") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 158: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #1545-D: (ULP 14.1) Array index of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #2553-D: (ULP 14.1) Array index (involving "j") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 172: remark #1527-D: (ULP 2.1) Detected SW delay loop using __delay_cycles. Recommend using a timer module instead"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 180: warning #161-D: declaration is incompatible with previous "showChar" (declared at line 165)"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 185: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 186: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 191: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 191: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 192: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 192: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 197: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 197: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 198: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 198: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 203: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 204: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 213: error #20: identifier "pos1" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 215: error #20: identifier "pos2" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 217: error #20: identifier "pos3" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 219: error #20: identifier "pos4" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 221: error #20: identifier "pos5" is undefined"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 223: error #20: identifier "pos6" is undefined13 errors detected in the compilation of "C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c".gmake: *** [hal_LCD.obj] Error 1Building file: "../main.c"Invoking: MSP430 Compiler"D:/ti/ccs/tools/compiler/ti-cgt-msp430_18.12.2.LTS/bin/cl430" -vmspx –data_model=restricted –use_hw_mpy=F5 –include_path="D:/ti/ccs/ccs_base/msp430/include" –include_path="D:/ti/msp430_driverlib_2_91_11_01/driverlib/MSP430FR5xx_6xx" –include_path="C:/Users/ewang/Desktop/program/tiworkspace/6989" –include_path="C:/Users/ewang/Desktop/driver of r6989/lcd" –include_path="D:/ti/ccs/tools/compiler/ti-cgt-msp430_18.12.2.LTS/include" –advice:power=all –advice:hw_config=all –define=__MSP430FR6989__ –define=_MPU_ENABLE -g –printf_support=minimal –diag_warning=225 –diag_wrap=off –display_error_number –silicon_errata=CPU21 –silicon_errata=CPU22 –silicon_errata=CPU40 –preproc_with_compile –preproc_dependency="main.d_raw" "../main.c"Finished building: "../main.c" gmake: Target 'all' not remade because of errors.

**** Build Finished ****

Susan Yang:

回复 user6003002:

请将CCS和MSP430WARE都放在默认路径,您这样是很容易出问题

user6003002:

回复 Susan Yang:

我已将CCS和MSP430WARE重新安装于默认路径,仍然不行

Susan Yang:

回复 user6003002:

还是原来的错误?

user6003002:

回复 Susan Yang:

与之前的错误相同,控制台错误信息为:
**** Build of configuration Debug for project 6989 ****

"C:\\ti\\ccs910\\ccs\\utils\\bin\\gmake" -k -j 8 all -O
Building file: "C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c"
Invoking: MSP430 Compiler
"C:/ti/ccs910/ccs/tools/compiler/ti-cgt-msp430_18.12.2.LTS/bin/cl430" -vmspx –data_model=restricted –use_hw_mpy=F5 –include_path="C:/ti/ccs910/ccs/ccs_base/msp430/include" –include_path="C:/ti/msp/MSP430Ware_3_80_07_00/driverlib/driverlib/MSP430FR5xx_6xx" –include_path="C:/Users/ewang/Desktop/program/tiworkspace/6989" –include_path="C:/Users/ewang/Desktop/driver of r6989/lcd" –include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-msp430_18.12.2.LTS/include" –advice:power="all" –advice:hw_config=all –define=__MSP430FR6989__ –define=_MPU_ENABLE -g –printf_support=minimal –diag_warning=225 –diag_wrap=off –display_error_number –silicon_errata=CPU21 –silicon_errata=CPU22 –silicon_errata=CPU40 –preproc_with_compile –preproc_dependency="driver of hal_LCD.d_raw""C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c"
>> Compilation failure
subdir_rules.mk:9: recipe for target 'hal_LCD.obj' failed
"C:\Users\ewang\Desktop\driver of r6989\lcd\hal_LCD.h", line 44: warning #41-D: expected an identifier
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 99: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 100: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 101: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 102: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 103: remark #1546-D: (ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 146: error #20: identifier "mode" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 165: warning #225-D: function "showChar" declared implicitly
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 165: error #20: identifier "pos1" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 166: error #20: identifier "pos2" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 167: error #20: identifier "pos3" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 168: error #20: identifier "pos4" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 169: error #20: identifier "pos5" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 170: error #20: identifier "pos6" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 150: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 155: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 156: remark #2553-D: (ULP 14.1) Array index (involving "t") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 158: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #1545-D: (ULP 14.1) Array index of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #2553-D: (ULP 14.1) Array index (involving "j") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 172: remark #1527-D: (ULP 2.1) Detected SW delay loop using __delay_cycles. Recommend using a timer module instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 155: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 156: remark #2553-D: (ULP 14.1) Array index (involving "t") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 158: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #1545-D: (ULP 14.1) Array index of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 161: remark #2553-D: (ULP 14.1) Array index (involving "j") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 172: remark #1527-D: (ULP 2.1) Detected SW delay loop using __delay_cycles. Recommend using a timer module instead
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 180: warning #161-D: declaration is incompatible with previous "showChar" (declared at line 165)
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 185: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 186: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 191: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 191: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 192: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 192: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 197: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 197: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 198: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 198: remark #2553-D: (ULP 14.1) Array index (involving "c") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 203: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 204: remark #2553-D: (ULP 14.1) Array index (involving "position") of type "int". Recommend using "unsigned int"
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 213: error #20: identifier "pos1" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 215: error #20: identifier "pos2" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 217: error #20: identifier "pos3" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 219: error #20: identifier "pos4" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 221: error #20: identifier "pos5" is undefined
"C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c", line 223: error #20: identifier "pos6" is undefined
13 errors detected in the compilation of "C:/Users/ewang/Desktop/driver of r6989/lcd/hal_LCD.c".
gmake: *** [hal_LCD.obj] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

灰小子:

回复 user6003002:

这个问题是编译器没有找到相应的文件,是典型的工程配置问题。

"C:\Users\ewang\Desktop\driver of r6989\lcd\hal_LCD.h", line 44: warning #41-D: expected an identifier

添加这个目录的时候,把反斜杠改为正斜杠试试

赞(0)
未经允许不得转载:TI中文支持网 » ccs9.1添加头文件问题
分享到: 更多 (0)