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.

[参考译文] TMS320F28377S:编译错误类型#1965无法打开源文件"math.h"

Guru**** 2439710 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1062751/tms320f28377s-compilation-error-type-1965-cannot-open-source-file-math-h

器件型号:TMS320F28377S

**** Build of configuration Debug for project motor-sw-proto-inverter-intg ****

"C:\\ti\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O 
 
'Building file: "../main.c"'
'Invoking: C2000 Compiler'
"C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.6.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --opt_for_speed=5 --fp_mode=relaxed --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg" --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/bsp/dev/incl" --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/src" --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/bsp/peripheral/incl" --advice:performance=all -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="main.d_raw"  "../main.c"

>> Compilation failure
subdir_rules.mk:9: recipe for target 'main.obj' failed
"C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/src/globals.h", line 15: fatal error #1965: cannot open source file "math.h"
1 catastrophic error detected in the compilation of "../main.c".
Compilation terminated.
gmake: *** [main.obj] Error 1

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

    您好!

    您可能需要在包含路径中添加$(CG_TOOL_ROOT)/lib/src、因为 math.h 位于该文件夹中。

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

    我尝试过这种方法但没有结果。 我注意到、在到达错误之前、这些包含路径未包含在构建日志中。 (向右滚动以查看包含路径)。

    **** Build of configuration Debug for project motor-sw-proto-inverter-intg ****
    
    "C:\\ti\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O 
     
    'Building file: "../main.c"'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.6.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --opt_for_speed=5 --fp_mode=relaxed --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg" --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/bsp/dev/incl" --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/src" --include_path="C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/bsp/peripheral/incl" --advice:performance=all -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="main.d_raw"  "../main.c"
    
    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'main.obj' failed
    "C:/Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/src/globals.h", line 15: fatal error #1965: cannot open source file "math.h"
    1 catastrophic error detected in the compilation of "../main.c".
    Compilation terminated.
    gmake: *** [main.obj] Error 1
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****
    

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

    从我的 make 文件中、

    -include sources.mk
    -include subdir_vars.mk
    -include bsp/dev/cmd/subdir_vars.mk
    -include bsp/dev/src/subdir_vars.mk
    -include bsp/peripheral/src/subdir_vars.mk
    -include src/subdir_vars.mk
    -include subdir_rules.mk
    -include bsp/dev/cmd/subdir_rules.mk
    -include bsp/dev/src/subdir_rules.mk
    -include bsp/peripheral/src/subdir_rules.mk
    -include src/subdir_rules.mk
    -include objects.mk

    这些工程属性编译应包含在何处? 我在这些.mk 文件中看不到它们

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

    您是否使用 makefile 来构建或 IDE? 我通常要构建 CCS/IDE。

    查看该命令、似乎没有新添加的路径作为 include 路径。 我刚才从您的输出复制了。

    "c:/ti/ccsv7/tools/compiler/ti-cgt-C2000-16.9.sps/bin/cl2000"-v28 -ml -cla_support=cla1 --float_support=fpu32 --tmu_support=tmu_support=vcu_support=vcu-mT --opt_for_support=cla1 --float_support=fpulat_support=fcpu_support=fu_support=fu_board-board-probulation_reus_board-board-board-board_support=fpf-intrat_support=g_support=f_support=fpulation_reus_board-board-board-board-board_support=f_board_board_support=f_supboard-board-board_board_board-inflat_board_superview-board_supboard_superview-cn_board_supmag_overview-cn_overview-cn_overview /Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/bsp/peripheral/incl /Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/src /Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg/bsp/dev/incl /Users/atp/Desktop/prototype-software/motor-sw-proto-inverter-intg

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

    我将使用 CCS 进行构建。  

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

    我找到了一个解决方案!

    在 Project properties > Paths and Symbols > Includes 中
    我添加了两个 include 目录

    我还需要将 ${CG_TOOL_ROOT}/lib 添加到 CCS 编译> C2000链接器>文件搜索路径--search_path 中