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.

Can't solve this problem with the linker....

Buliding a simple main as this:

#include "csl_i2c.h"
void main(){
    CSL_I2cSetup     i2cSetup;
    I2C_setup(&i2cSetup);
}

even if I linked the csl header in the build properties, I obtain three errors:

errors encountered during linking; "prova.out" not built

Linking failed. Check the Console window for details.

unresolved symbol _I2C_setup, first referenced in ./main.obj

 

 

...and on the console I read this:

**** Build of configuration Debug for project prova ****

C:\Programmi\Texas Instruments\ccsv4\utils\gmake\gmake -k all
'Building file: ../main.c'
'Invoking: C5500 Compiler'
"C:/Programmi/Texas Instruments/ccsv4/tools/compiler/c5500/bin/cl55" -g --include_path="C:/Programmi/TMS320VC55XCSL-LOWPWR/VC5505_CSL/inc" --include_path="C:/Programmi/Texas Instruments/ccsv4/tools/compiler/c5500/include" --diag_warning=225 --sat_reassoc=off --ptrdiff_size=16 --fp_reassoc=off --memory_model=small --asm_source=mnemonic  --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
"../main.c", line 5: warning: last line of file ends without a newline
'Finished building: ../main.c'
' '
'Building target: prova.out'
'Invoking: C5500 Linker'
"C:/Programmi/Texas Instruments/ccsv4/tools/compiler/c5500/bin/cl55" -z -m"prova.map" --warn_sections -i"C:/Programmi/TMS320VC55XCSL-LOWPWR/VC5505_CSL/lib" -i"C:/Programmi/Texas Instruments/ccsv4/tools/compiler/c5500/lib" -i"C:/Programmi/Texas Instruments/ccsv4/tools/compiler/c5500/include" --reread_libs --rom_model -o "prova.out"  "./main.obj" -l"rts55.lib"
<Linking>
warning: creating ".stack" section with default size of 0x3e8; use the -stack
   option to change the default size
warning: creating ".sysstack" section with default size of 0x3e8; use the
   -sysstack option to change the default size

 undefined  first referenced
  symbol        in file    
 ---------  ----------------
 _I2C_setup ./main.obj     

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

>> Compilation failure
C:\Programmi\Texas Instruments\ccsv4\utils\gmake\gmake: *** [prova.out] Error 1
C:\Programmi\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.
Build complete for project prova

 

What should I do?

Thanks

 

Andrea

 

  • I tried and tried again but nothing changes....I just open the project build properties and add in the Include options the path of the headers that I'm using and in File Search Path the path of the libraries...but it doesn't  work.Is this the right way to make the CSL work?

    Thanks for you help

    Andrea

  • There are two things you have to do to use a library like you are trying to do: Setup the include path (which you did) and specify to actually link to the binary (which you haven't, it would seem).

    First, find where the generated .lib file is for the library you want. It should be in a build/release folder. Then go into the build options and look on the linker tab (This assumes you have CC 3.3). Go into 'categories', and add the folder with the .lib file to the search path text field. Also, you'll need to add the actual lib file name to the 'Incl. Libraries' input. Note that both lists are delimited by a semi-colon.

    Do that, rebuild, and you should be at least one step closer.

  • Hi Andrea,

    As Justin said, it looks like you have correctly included the CSL header files but incorrectly included the CSL library.

    Based on your console output, you need to include the following library in your linker library search path:
    "C:/Programmi/TMS320VC55XCSL-LOWPWR/VC5505_CSL/lib/cslVC5505L.lib"

    1) In the project build properties window, under the “Tool Settings” tab, scroll down to the C5500 Linker section and click on “File Search Path”.
    2) Make sure that “cslVC5505L.lib” is added to the “Include library file or command file as input” section.
    3) Add the path to your CSL lib folder to the “Add <dir> to library search path” section
        For you, this path should be “C:/Programmi/TMS320VC55XCSL-LOWPWR/VC5505_CSL/lib/”

    There should be four library files in your lib folder: cslVC5504H.lib, cslVC5505H.lib, cslVC5504L.lib, and cslVC5505L.lib. Note that these libraries are built specifically for the VC5504/05 devices with Huge and Large memory models only.

    I see from your console output that you have configured your project to use the small memory model. None of these CSL libraries will work with the small memory model (unless you rebuild the CSL for small memory model).

    Change your memory model to use the Large Memory Model instead:
    1) In the C5500 Linker section of the build properties click on “File Search Path” again.
    2) Make sure that “rts55x.lib” appears in the “Include library file or command file as input” section.
    3) In the C5500 Compiler section of the build properties click on “Runtime Model Options”
    4) Check the “Use large memory model” box
    5) Change the “Specify type size to hold results of pointer math” field to “32 (default)”
    6) Change the “Specify memory model (small/large/huge)” field to “Large”

    The C5500 Linker, File Search Path section should look like this:

     

    The C5500 Compiler, Runtime Model Options section should look like this:

     

    Hope this helps. Let me know if you have any difficulties.

    Regards,
    Mark