# sdcc missing library issue

#### scsi050

Joined Feb 27, 2014
2
I'm trying to get a very simple C code compiled with sdcc, but I can't get past this missing lib file error:

Rich (BB code):
root@server:/home/xxxx/testpic# sdcc -mpic14 -p16f877 test.c
pic16f877.lib: No such file or directory

SDCC version on Debian:
SDCC : mcs51/gbz80/z80/z180/r2k/ds390/pic16/pic14/TININative/ds400/hc08 3.1.0 #7066 (Jun 5 2012) (Linux)

test.c :
Rich (BB code):
#include <string.h>

char strl[10];

void main(void) {
strcpy(strl, "testing");
}

Any suggestions? thanks

#### spinnaker

Joined Oct 29, 2009
7,837
That is the linker library file for the pic. Are you using a 16f877? Do you have the directory set correctly ?

What is sdcc??

#### scsi050

Joined Feb 27, 2014
2
Yes i'm using a p16f877 (but regardless of which actual chip I'd be programming, it should be able to compile regardless, as long as I have the necessary compiler files).

I'm not sure if I have the directory set correctly or not. No where on my filesystem can I find the file p16f877.lib

Rich (BB code):
root@server:~# sdcc --print-search-dirs
programs:
/usr/bin
/usr/bin/../share
/usr/share
includedir:
/usr/bin/../share/sdcc/include/mcs51
/usr/share/sdcc/include/mcs51
/usr/bin/../share/sdcc/include
/usr/share/sdcc/include
libdir:
/usr/bin/../share/sdcc/lib/small
/usr/share/sdcc/lib/small
libpath:

sdcc (http://sdcc.sourceforge.net/) is a C compiler that i'm trying to use to compile by C code into the HEX assembly file.

#### spinnaker

Joined Oct 29, 2009
7,837
Then you need to talk to someone on sdcc. I doubt you will find support for it here. Most likely you need to install a linker library in addition to the complier.

If you install XC8 or MPLab C you won't have all of these issues.