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.

关于程序包含CSL库的问题



我在编写6678程序的时候,由于要用到CSL_chipReadReg()这个函数,于是就在程序里包含了头文件#include <ti/csl/csl_chip.h>

程序build的时候说找不到csl_chip.h这个文件,然后我在工程build setting里的include search path里加入了csl_chip.h文件的路径(我的MCSDK是装在C盘底下的,CCS装在D盘底下),再次build的时候上一个错误消失了,但是又有了一个新的错误,说我的 CSL_chipReadReg()是undefined symbol。

 

这该怎么解决啊?我的工程是建立在G盘底下的。

  • 请在include searche path中包含相应的CSL lib库。

  • Andy Yin  您好!

    我在C6000 Linker的File Search Path中添加了CSL lib库的地址(如下)但是依然不行。还是说 CSL_chipReadReg()是undefined symbol。

    C:\Program Files\Texas Instruments\pdk_C6678_1_0_0_9_beta2\packages\ti\csl\lib

  • 一般这种问题都是你的库和头文件路径不对,请仔细检查

  • chao fan您好,

    请确认选择上述目录下的CSL lib文件,如ti.csl.ae66e,同时请留意编译链接时是否存在相应的CSL lib,如果还存在问题,请将编译时打印的东西贴上来,谢谢

  • Andy Yin 您好,

    我把CSL lib库加入了,但是情况还是像原来一样,编译的提示是这样的:

    'Building target: matrix_transposition.out'

    'Invoking: C6000 Linker'

    "D:/Program Files/Texas Instruments/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6600 -g -O2 --diag_warning=225 --abi=eabi -z -m"matrix_transposition.map"  --stack_size=400 --warn_sections -i"D:/Program Files/Texas Instruments/pdk_C6678_1_0_0_16/packages/ti/csl/lib" -i"D:/Program Files/Texas Instruments/ccsv5/tools/compiler/c6000/lib" -i"D:/Program Files/Texas Instruments/ccsv5/tools/compiler/c6000/include"  --reread_libs --rom_model -o "matrix_transposition.out"  "./matrix_trans.obj" -l"libc.a" "../matrix.cmd"

    <Linking>

    warning: creating output section ".neardata" without a SECTIONS specification.

      For additional information on this section, please see the 'C6000 EABI

      Migration' guide at

      processors.wiki.ti.com/.../C6000_EABI:C6000_EABI_Migration

      EABI_Sections

    warning: creating output section ".rodata" without a SECTIONS specification.

      For additional information on this section, please see the 'C6000 EABI

      Migration' guide at

      processors.wiki.ti.com/.../C6000_EABI:C6000_EABI_Migration

      EABI_Sections

    warning: creating group "NEARDP_DATA" to co-locate output sections .neardata

      and .rodata with .bss

    undefined       first referenced  

     symbol             in file      

    ---------       ----------------  

    CSL_chipReadReg ./matrix_trans.obj

    error: unresolved symbols remain

    error: errors encountered during linking; "matrix_transposition.out" not built

    我试着把csl_chip.c这个文件复制一份到工程目录底下,结果编译通过了。但是我还是想找出不用复制源文件到工程目录下使用库函数的方法。谢谢帮助!

  • 您好,

    我在本机测试结果如下,请参考。

    在没有添加相应的CSL lib时,对应编译提示如下:

    'Invoking: C6000 Linker'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2/bin/cl6x" -mv64+ -g --define=TEST_MULTIPLE_INSTANCES --diag_warning=225 --abi=eabi -z -m"FFTC_MultiInst_testProject.map" --warn_sections -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2/lib" -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2/include" --reread_libs --rom_model -o "FFTC_MultiInst_testProject.out" -l"./configPkg/linker.cmd"  "./test_singlecore_shift.obj" "./test_singlecore_queueshare.obj" "./test_singlecore_psinfo.obj" "./test_singlecore_poll.obj" "./test_singlecore_multipleinst.obj" "./test_singlecore_flowshare.obj" "./test_singlecore_dftlist.obj" "./test_singlecore.obj" "./test_osal.obj" "./test_multicore.obj" "./test_mono_singlecore_psinfo.obj" "./test_mono_singlecore.obj" "./test_main.obj" "./test_lld.obj" "./qmss_device.obj" "./listlib.obj" "./fftc_lld.obj" "./fftc.obj" "./cppi_device.obj" -l"libc.a" "C:/Program Files/Texas Instruments/pdk_C6670_1_0_0_9_beta2/packages/ti/drv/fftc/test/fftc_linker.cmd"

    <Linking>

    undefined       first referenced          

     symbol             in file                

    ---------       ----------------          

    CSL_chipReadReg ./test_singlecore_shift.obj

    在加入C:\Program Files\Texas Instruments\pdk_C6678_1_0_0_9_beta2\packages\ti\csl\lib\ti.csl.ae66之后,编译提示如下:

    'Invoking: C6000 Linker'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2/bin/cl6x" -mv64+ -g --define=TEST_MULTIPLE_INSTANCES --diag_warning=225 --abi=eabi -z -m"FFTC_MultiInst_testProject.map" --warn_sections -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2/lib" -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2/include" --reread_libs --rom_model -o "FFTC_MultiInst_testProject.out" -l"./configPkg/linker.cmd"  "./test_singlecore_shift.obj" "./test_singlecore_queueshare.obj" "./test_singlecore_psinfo.obj" "./test_singlecore_poll.obj" "./test_singlecore_multipleinst.obj" "./test_singlecore_flowshare.obj" "./test_singlecore_dftlist.obj" "./test_singlecore.obj" "./test_osal.obj" "./test_multicore.obj" "./test_mono_singlecore_psinfo.obj" "./test_mono_singlecore.obj" "./test_main.obj" "./test_lld.obj" "./qmss_device.obj" "./listlib.obj" "./fftc_lld.obj" "./fftc.obj" "./cppi_device.obj" -l"libc.a" -l"C:\Program Files\Texas Instruments\pdk_C6678_1_0_0_9_beta2\packages\ti\csl\lib\ti.csl.ae66" "C:/Program Files/Texas Instruments/pdk_C6670_1_0_0_9_beta2/packages/ti/drv/fftc/test/fftc_linker.cmd"

    <Linking>

    'Finished building target: FFTC_MultiInst_testProject.out'

  • 谢谢Andy Yin的耐心解答,问题已经解决了,深深佩服你们负责的工作态度!