Using C-Callable IP Libraries

Using a C-callable library is similar to using any software library. You #include header files for the library in appropriate source files and use the sdscc -I<path> option to compile your source, for example

> sdscc –c –I<path to header> –o main.o main.c

When you are using the SDSoC IDE, you add these sdscc options by right-clicking on your project, selecting C/C++ Build Settings->SDSCC Compiler->Directories (or SDS++ Compiler->Directories for C++ compilation).

To link the library into your application, you use the -L<path> and -l<lib> options.
> sdscc –sds-pf zc702 ${OBJECTS} –L<path to library> -l<library_name> –o myApp.elf

As with the standard GNU linkers, for a library called libMyLib.a, you use -lMyLib.

When you are using the SDSoC IDE, you add these sdscc options by right-clicking on your project, selecting C/C++ Build Settings > SDS++ Linker > Libraries.

You can find code examples that employ C-callable libraries in the SDSoC™ environment installation under the samples/fir_lib/use and samples/rtl_lib/arraycopy/use directories.