Generating C code from a Matlab-Simulink: errors encountered during linking

dacdspembeddedMATLABprogramming

I generated C code from a Matlab-Simulink model (In Matlab help is "Parametric Audio Equalizer"

-> "Task 6 – Integrate Device Drivers" -> "Configuration C") with a "Target Preferences" module

for a "OMAP_L138/C6748 EVM" Board with a "OMAP138" Processor.

With the Incremental Build option (Simulink), the Code Composer Studio project is generated,

compilated, but when is linking I get this error in Simulink and CCS:

SIMULINK:

The call to idelink_ert_make_rtw_hook, during the exit hook generated the following error:
Error while building the project.
The build process will terminate as a result.

CCS:

[Linking...] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -@"CustomMW.lkf"
<Linking>

undefined           first referenced                                                                 
 symbol                 in file                                                                     
---------           ----------------                                                             

_PMI_getModuleState  C:/CCStudio_v3.3/bios_5_33_06/packages/ti/bios/lib/bios6748.a674<pwrm_set674.o674>

_PMI_setModuleState C:/CCStudio_v3.3/bios_5_33_06/packages/ti/bios/lib/bios6748.a674<pwrm_set674.o674>

__PWRM_CAPSMASK C:/CCStudio_v3.3/bios_5_33_06/packages/ti/bios/lib/bios6748.a674<pwrm_set674.o674>

error: unresolved symbols remain
error: errors encountered during linking; "audioworkflow_devdrivers.out" not built

Compilation failure

Build Complete,
1 Errors, 0 Warnings, 0 Remarks.

Thanks

Best Answer

Typical unresolved symbols appear because the code (written/generated) is referencing external methods or types that are well DECLARED but its DEFINITIONS are not provided. Declarations are commonly in .h files included in the source code. How you provide this definitions? - You need pass the LIBRARY containing these definitions during the linker pass of the build process. Libraries are .a or .lib files depending of the compiler used. - Other way to pass these definitions is include other .c or .cpp files in the compilation process that define these symbols (methods, types, vars).

In your case, you need check the CSS documentation to resolve if you need code your own .c/.cpp or where you can get the .a/.lib library files or may be you need check the path of the libraries.

Related Topic