Testing a Library

To test a C-callable library, create a program that uses the library, and #include the appropriate header file in your source code.

When compiling the code that calls a library function, provide the path to the header file using the –I switch:
sdscc –c –I<path to header> –o main.o main.c
To link against a library, use the –L and –l switches:
sdscc –sds-pf zc702 ${OBJECTS} –L<path to library> -lcount –o count.elf

In the example above, the compiler uses the library libcount.a located at <path to library>.