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.

[参考译文] CODECOMPOSER:未定义的符号

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1313464/codecomposer-undefined-symbol

器件型号:CODECOMPOSER
主题中讨论的其他器件:C2000WARESysConfig

大家好!

我有一个简单的以下代码:

#include "device.h"
#include "driverlib.h"

void main(){
    Device_init();
}

函数 Device_init()在"device.h"中定义,我已经包括了它。

  

为什么我仍然收到以下错误:

**** Build of configuration Debug for project Test_I2C ****

"C:\\ti\\ccs1020\\ccs\\utils\\bin\\gmake" -k -j 20 all -O 
 
Building file: "../main.c"
Invoking: C2000 Compiler
"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 --include_path="C:/VietDucK19/CCS/I2c/Test_I2C" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/device_support/f2807x/common/include" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/device_support/f2807x/headers/include" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/c2000/C2000Ware_5_01_00_00/driverlib/f2837xd/driverlib/inc" --include_path="C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --preproc_with_compile --preproc_dependency="main.d_raw"  "../main.c"
Finished building: "../main.c"
 
Building target: "Test_I2C.out"
Invoking: C2000 Linker
"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -g --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi -z -m"Test_I2C.map" --stack_size=0x200 --warn_sections -i"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/lib" -i"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="Test_I2C_linkInfo.xml" --rom_model -o "Test_I2C.out" "./main.obj" "../2837x_FLASH_lnk_cpu1.cmd"  -llibc.a 
<Linking>
 
 undefined    first referenced
  symbol          in file     
 ---------    ----------------
 _Device_init ./main.obj      
 
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "Test_I2C.out" not built
 
>> Compilation failure
makefile:141: recipe for target 'Test_I2C.out' failed
gmake[1]: *** [Test_I2C.out] Error 1
makefile:137: recipe for target 'all' failed
gmake: *** [all] Error 2

**** Build Finished ****

有人能帮我吗、提前感谢你。

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

    您好!

    我将把您的主题发送给 C2000团队。 如果您在一天左右的时间内没有得到回复、请随意 ping 该主题。

    此致、

    尼克

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

    您好、Nick。

    非常感谢。 感谢你的帮助。

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

    它是在 device.h 中*定义*还是*声明*?

    如果它只是 device.h 中的原型、您可能需要确保搜索路径中包含您的例程的源文件。

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

    很抱歉混淆不清、它在 device.h 中声明

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

    您好!

    确保在"工程属性"中设置了正确的包含路径和库路径(您可以参阅 C2000Ware 中适用于所使用器件的示例)。 Device_init 函数在 device.c 文件中定义、如果无法识别该函数、则表示您尚未将项目配置为包含正确的 driverlib 源代码。

    作为一项一般性建议、您应该在 C2000Ware 5.01中、基于 F2837x/F2807x 器件的 empty_project 模板来创建项目(对于其他器件、您应该能够使用具有 SysConfig 通用项目设置的通用示例)。