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/EVM430-FR6047:链接器错误:"未定义符号"

Guru**** 2577385 points
Other Parts Discussed in Thread: MSP430FR6047

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/833884/ccs-evm430-fr6047-linker-errors-undefined-symbol

器件型号:EVM430-FR6047
主题中讨论的其他器件:MSP430FR6047

工具/软件:Code Composer Studio

链接器在原始帖子中的大多数语句中为我提供了"未定义符号"错误:

#include
#include
#include

void main (void){
  // WDTCTL = WDTPW | WDTHOLD;//停止看门狗计时器
  WDT_A_HOLD (WDT_A_base);

  //P7.5输出
  GPIO_setAsOutputPin (GPIO_PORT_P7、GPIO_PIN5);


  /*
  *禁用 GPIO 上电默认高阻抗模式以激活
  *先前配置的端口设置
  *
  PMM_unlockLPM5 ();

  while (1)
  {
    //切换引脚
    GPIO_toggleOutputOnPin (GPIO_PORT_P7、GPIO_PIN5);

    _DELAY_CYCLES (1000000);
  }

以下是链接器错误:

构建目标:"rioGpioBlink01.out"
调用:MSP430链接器
"c:/ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.6.LTS/bin/cl430 /ti/ccsv8/ccs_base/msp430/include /ti/ccsv8/ccs_base/msp430/lib/5xx_6xx_FRxx /ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.6.LTS/include -vmspx --data_model=restricted --use_hw_mpy=F5 --advice:power=all --advice:hw_config=all --define=_MSP430FR6047__/ti/ccsv8/ccs_base/lib SECTIONS --define=_mpu_enable -g --printf_support=minimal --diag_warning=225 --ature-config_off-cn_isore-example-cn-cn-cn_cpature=-cn-cn-cn-cn-cn_cpature=-cn-cn-cn-cn-cn_up-cn-cn-cn-cn-out-cn-atic"-cn_cpategot-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn_up-out-cn-cn-cn-out-atic"-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-out-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-out-cn-cn-cn-cn /ti/ccsv8/tools/compiler/ti-cgt-msp430_18.1.6.LTS/lib /ti/ccsv8/ccs_base/msp430/lib/FR59xx

警告#10420-D:对于 FRAM 器件、启动时需要禁用 GPIO 上电默认高阻抗模式、以激活先前配置的端口设置。 这可以通过清零 PM5CTL0寄存器中的 LOCKLPM5位来完成。

未定义的首次引用
符号
------ --------
GPIO_setAsOutputPin ./blink.obj
GPIO_toggleOutputOnPin ./blink.obj
PMM_unlockLPM5 ./blink.obj
WDT_A_HOLD ./BLINK

要编译程序、我必须在#include 搜索路径中添加一个目录、以便找到该目录

C:\ti\MSP\UltrasonicWaterFR604x_02_20_00_04\driverlib\MSP430FR5xx_6xx
${CCS_base_root}/MSP430/include
${PROJECT_ROOT}
${CG_TOOL_ROOT}/包含

很明显、现在链接器找不到正确版本的 driverlib.lib。 以下是库搜索路径:

${CCS_base_root}/MSP430/include
${CCS_base_root}/lib
${CCS_base_root}/MSP430/lib/5xx_6xx_FRxx
${CCS_base_root}/MSP430/lib/FR59xx
${CG_TOOL_ROOT}/lib
${CG_TOOL_ROOT}/包含

我想我不确定应该如何安装正确版本的接头和库。 是否有一种简单的方法来确保连接器安装并找到正确的 driverlib?

谢谢!

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

    您好!

    如果您的 CCS 版本不是最新版本、我建议您对其进行更新。  您可以从以下链接下载。

    http://software-dl.ti.com/ccs/esd/documents/ccs_downloads.html

    此外、下面还提供了 FR604x 水演示示示示示例代码(2.20.00.08)的更高版本、我建议使用该版本、因为存在一些错误修复。

    http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/USSSWLib/USSSWLibWater/latest/

    我认为、如果您同时更新和导入新项目、它应该能够找到正确版本的 driverlib。  请告诉我这是否能解决您的问题。

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

    安装 CCS 9.10和新的水演示代码后、我仍然遇到链接器错误。 为了修复错误、结果我需要向项目中添加指向三个源文件的链接:

    • gpio.c
    • PMM.c
    • WDT_a.c.

    由于该程序使用此处定义的函数:

    #include
    #include
    /**
     * main.c
     *
    int main (空)

       //停止 WDT
       WDT_A_HOLD (WDT_A_base);             //需要 WDT_a.c
       //P7.5输出
       GPIO_setAsOutputPin (GPIO_PORT_P7、GPIO_PIN5); //需要 GPIO_c

       PMM_unlockLPM5 ();                //需要 PMM.c
       while (1)
       {
         //切换引脚
         GPIO_toggleOutputOnPin (GPIO_PORT_P7、GPIO_PIN5); //需要 GPIO_c
         _DELAY_CYCLES (1000000);
       }
     
    我以前做过一些 C 语言编程、而构建配置在每个新环境中都带来了很多麻烦。