Hi,

> 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
> __sdcc_gsinit_startup
>
> 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  
SFRs.


When calling sdcc -V on a single-file project, you can see the linker  
include paths,
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  
linker
script to use, -w suppresses some useless warnings, -r allows to use  
SHAREBANK
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*  
libsdcc.lib
and should be good to go in no time.

Best of luck


Raphael

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to