Hi, > Got the right path: /usr/local/share/sdcc and this folder has other > three: include, lib and non-free. I notice that libc18f is not in > /usr/local/share/sdcc/non-free/lib/pic16 but in but in > /usr/local/share/sdcc/lib/pic16 folder.
OK, now you need tell gplink to (i) look there and (ii) to include libc18f.lib during linking. > After addign this line to code strcpy(str1, "testing") {str1 => char > str1[10]} I get this error: > > /usr/local/bin/sdcc --debug-ralloc -Wl-c -Wl-m --use-non-free > --pstack-model=large --pno-banksel --extended --obanksel=2 --debug-xtra > --pcode-verbose -L /usr/local/share/sdcc/lib/ -L /usr/share/sdcc/lib/ > -I/usr/local/share/sdcc/include -I/usr/local/share/sdcc/include/pic16/ > -mpic16 -p18f4550 build/default/production/main.o > -odist/default/production/Pic18F4550Test.X.production.cof > message: using default linker script "/usr/share/gputils/lkr/18f4550.lkr" > error: missing definition for symbol "_strcpy", required by > "build/default/production/main.o" > This is weird because libraries are there... Don't no what else I can do. As I wrote earlier, you must tell the linker to include libc18f.lib: >> You need to append libc18f.lib to the linker command line. Here is your current linker command (the one that fails): > /usr/local/bin/sdcc --debug-ralloc -Wl-c -Wl-m --use-non-free > --pstack-model=large --pno-banksel --extended --obanksel=2 --debug-xtra > --pcode-verbose -L /usr/local/share/sdcc/lib/ -L /usr/share/sdcc/lib/ > -I/usr/local/share/sdcc/include -I/usr/local/share/sdcc/include/pic16/ > -mpic16 -p18f4550 build/default/production/main.o > -odist/default/production/Pic18F4550Test.X.production.cof Problems: As you pointed out earlier, libc18f.lib does not reside in any of the paths given here after -L. What's more, you found out that libc18f.lib does not reside in .../non-free/lib/pic16, so --use-non-free will still not point the linker to the right path. Solutions: (1) Add -L /usr/local/share/sdcc/lib/pic16 to the link command. (2) Append libc18f.lib to the link command. In a autoconf-compliant Makefile, this might be done by extending the LIBS variable; LDADD might also work if it is combined into the linker command following all files to be linked (after .../main.o). In MPLAB X, I have no clue where/how to append this. To give you more information on how the tools (assembler, linker) are invoked, you can also include -V in the linker command to see what's actually passed on to gplink. Its arguments must include (i) a proper -L /path/to/libc18f.lib directive, (ii) /path/to/main.o, (iii) libc18f.lib (possibly including the complete /path/to/libc18f.lib to avoid further problems with automatic searching) -- and in this order: (iii) *must* come after (i) and (ii). I hope this clears things up. Raphael ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user