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.

Undefined first Referenced symbol

Other Parts Discussed in Thread: CONTROLSUITE

Hello All,

I have the following question after build my project. I am running CCS 5.5 on win7 and the compiler is 6.2. I have checked the similar topic in our E2E, but still have not got a solution.

The ePWM is decleared in "PWM_ComplPairDB_Cnf.C" : extern volatile struct EPWM_REGS *ePWM[];

and  "PWM_ComplPairDB_Cnf.C" includes the header file EPwm.h where the EPWM_REGS is defined.

Besides, I checked header file path is included in the compiler and also linker.

Thank you for your help!

Tian


**** Build of configuration Debug for project newLLC ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building target: newLLC.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --cla_support=cla0 --float_support=fpu32 --vcu_support=vcu0 -g --diag_warning=225 --display_error_number --diag_wrap=off -z -m"newLLC.map" --stack_size=0x300 --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.2.0/lib" -i"C:/ti/controlSUITE/device_support/f2806x/v151/F2806x_headers/include" -i"C:/ti/controlSUITE/libs/app_libs/digital_power/f2806x_v3.5/asm_macros" -i"C:/ti/controlSUITE/libs/app_libs/digital_power/f2806x_v3.5/include" -i"C:/ti/controlSUITE/libs/math/IQmath/v15c/include" -i"C:/Users/tliu/Documents/TI_LLC/headers/F2806x_peripheral_headers" -i"C:/Users/tliu/Documents/TI_LLC/headers/F2806x_common/include" -i"C:/Users/tliu/Documents/TI_LLC/headers/F2806x_headers/include" -i"C:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --reread_libs --display_error_number --diag_wrap=off --xml_link_info="newLLC_linkInfo.xml" --rom_model -o "newLLC.out" "./SciCommsGui.obj" "./PWM_ComplPairDB_Cnf.obj" "./PWM_1ch_UpCntDB_Compl_Cnf.obj" "./PWM_1ch_UpCntDB_Cnf.obj" "./PWM_1ch_Cnf.obj" "./HVLLC-Main.obj" "./HVLLC-DevInit_F28069.obj" "./HVLLC-DPL-ISR.obj" "./F2806x_usDelay.obj" "./F2806x_GlobalVariableDefs.obj" "./F2806x_CodeStartBranch.obj" "./ADC_SOC_Cnf.obj" "../F28027_FLASH_HVLLC.CMD" "C:/ti/controlSUITE/device_support/f2806x/v151/F2806x_headers/cmd/F2806x_Headers_nonBIOS.cmd" "C:/ti/controlSUITE/libs/math/IQmath/v15c/lib/IQmath.lib" -l"libc.a"
<Linking>

undefined first referenced
symbol in file
--------- ----------------
_ePWM ./PWM_ComplPairDB_Cnf.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "newLLC.out" not built

>> Compilation failure
gmake: *** [newLLC.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

  • I am not familiar with controlSUITE projects, but I can offer some insight.

    ipower said:
    The ePWM is decleared in "PWM_ComplPairDB_Cnf.C" : extern volatile struct EPWM_REGS *ePWM[];

    This is a declaration of ePWM.  It is not definition, which means it does not cause memory to be allocated for it.

    ipower said:
    and  "PWM_ComplPairDB_Cnf.C" includes the header file EPwm.h where the EPWM_REGS is defined.

    This header file contains the definition of the type EPWM_REGS.  But no definition of ePWM.  Again ePWM has no memory allocated for it.

    And that is why the linker complains that ePWM is undefined.

    Please visit here for a general overview of this entire topic.

    I'm sorry I cannot tell you where ePWM should be defined.  That requires detailed knowledge of controlSUITE.

    Thanks and regards,

    -George

  • Hello George,

    Thank you for pointing out that. You are correct. After deleting the extern in the source file, that means ePWM[] is defined and then the build passed.

    Thank you!

    Tian