> I manged to get a two .c file project compiling ang linked, upon reading
> the bin/release .lst file I see this
> 000002 2803 goto 0x3 goto
> but no routine with the name. __sdcc_gsinit_startup
This is perfectly normal -- library routines do not show up in the .lst.
If the linker does not complain, everything is (probably) fine.
Otherwise, you need to link against the SDCC library (which includes
__sdcc_gsinit_startup() to initialize global and/or static data,
routines to dereference generic pointers, mulit-byte arithmetic
routines, etc.) and the device library for the target chip,
pic16f874.lib in your case, which mainly provides the definitions of the
When calling sdcc -V on a single-file project, you can see the linker
linker scripts, and required files, something like the heavily edited:
+ "gplink" -I"%SDCC%/lib/pic" -m -s %GPUTILS%/lkr/16f877.lkr -w -r -o demo
demo.o libsdcc.lib pic16f877.lib
-I are linker search paths (where to find .lib files), -s points to the
script to use, -w suppresses some useless warnings, -r allows to use
for DATABANKs, -o specifies the output file basename.
demo.o was compiled from demo.c (the single source file),
libsdcc.lib and pic16f877.lib are the sdcc and device libraries.
You basically have to insert all your compiled source files *before*
and should be good to go in no time.
Best of luck