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.

lib linking problem



I want to call PSCModuleControl from my app. I added "C6748_StarterWare_1_20_02_02\binary\c674x\cgt_ccs\c6748\drivers\Debug\drivers.lib" to the linker search path.  But I still get the error "unresolved symbol _PSCModuleControl".

any idea what am I doing wrong?

  • more info.

    copied the project to another workspace. the symbol is found and the link succeeds.

    so I deleted .metadata and cleaned the workspace. but I still get the same error...

  • Kurt,

    Was the output of the build console the same in both cases? I am wondering if, for some reason, the library was not added to the link in the first case. Do you actually see it specified in the link command on the build console?

  • Turns out I was confused... When I returned to the workspace that succeeded I found that the code was not using the PSCModuleControl function. Therefore I am not able to build successfully under any conditions. I even created a new workspace and a new project - same unresolved reference.

    Yes, drivers.lib is specified on the command line. I even broke the link, and got an error, by moving the file just to be sure the linker was really looking in drivers.lib.

  • Could you attach the complete output of the build console? And also if possible the source file that calls the PSCModuleControl function?

  • I can only attach one file.  So here is the console output

    **** Build of configuration Debug for project NanoScan2 ****

    C:\ti\ccsv5\utils\bin\gmake -k all
    'Building target: NanoScan2.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --define=c6748 --display_error_number --diag_warning=225 --abi=coffabi -z -m"NanoScan2.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c6000/lib" -i"C:/ti/ccsv5/tools/compiler/c6000/include" -i"../../C6748_StarterWare_1_20_02_02/binary/c674x/cgt_ccs/c6748/drivers/Debug" --reread_libs --rom_model -o "NanoScan2.out" -l"./configPkg/linker.cmd"  "./intvecs.obj" "./interrupt.obj" "./cache.obj" "./Main.obj" "./Init.obj" -l"libc.a" -ldrivers.lib
    <Linking>

     undefined         first referenced
      symbol               in file    
     ---------         ----------------
     _PSCModuleControl ./Init.obj     

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

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

    **** Build Finished ****

  • Kurt,

    I see that your project build options are using --abi=coffabi but the library drivers.lib seems to be built for EABI. In EABI the symbol names do not have the underscore that COFF ABI symbol names do, which could explain why it is looking for a symbol named _PSCModuleControl while the actual symbol name in the library is PSCModuleControl (since it was compiled for EABI). More details here: http://processors.wiki.ti.com/index.php/C6000_EABI_Migration#COFF_Underscore_Name_Mangling

    Could you change your project build options to --abi=eabi and see if that resolves the error?

  • How do I "change your project build options to --abi=eabi"?

  • Kurt Jensen said:

    How do I "change your project build options to --abi=eabi"?

    You can get to it from Project Properties (see screenshot).

  • ah ha!  that be it!

    Well done.  Thank you.