Hello Raphael.
You are right. Folder /usr/share/sdcc/non-free does not exists. I build again
SDCC with this parameter:
non_free_lib_dir_suffix="non-free/lib".
Builds all, inclusive non-free lib and include, but 'make install' does not
copy non-free folder to /usr/share/sdcc.
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.
Issue remains, after changing parameters to right path.
This is what I get without making a string copy:
/usr/local/bin/sdcc --debug-ralloc --use-non-free --pstack-model=large
--pno-banksel --extended --obanksel=2 -L /usr/local/share/sdcc/lib/
-I/usr/local/share/sdcc/include -I/usr/local/share/sdcc/include/pic16/ -c
-mpic16 -p18f4550 main.c -obuild/default/production/main.o
main.c:137: warning 85: in function main unreferenced local variable : 'str1'
mkdir -p dist/default/production
/usr/local/bin/sdcc --debug-ralloc -Wl-c -Wl-m --use-non-free
--pstack-model=large --pno-banksel --extended --obanksel=2 -L
/usr/local/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"
make[2]: Leaving directory `/home/amartins/MPLABXProjects/Pic18F4550Test.X'
make[1]: Leaving directory `/home/amartins/MPLABXProjects/Pic18F4550Test.X'
BUILD SUCCESSFUL (total time: 498ms)
Loading
/home/amartins/MPLABXProjects/Pic18F4550Test.X/dist/default/production/Pic18F4550Test.X.production.cof...
Loading completed
After addign this line to code strcpy(str1, "testing") {str1 => char str1[10]}
I get this error:
/usr/local/bin/sdcc --debug-ralloc --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/ -c
-mpic16 -p18f4550 main.c -obuild/default/production/main.o
pcode.c:3292 converting to 'A'bsolute pBlock
pcode.c:3292 converting to 'A'bsolute pBlock
pcode.c:3292 converting to 'A'bsolute pBlock
pcode.c:3292 converting to 'A'bsolute pBlock
WARNING: couldn't associate label _00105_DS_ with an instruction
WARNING: couldn't associate label _00110_DS_ with an instruction
No registers saved on this pass
No registers saved on this pass
mkdir -p dist/default/production
/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"
make[2]: Leaving directory `/home/amartins/MPLABXProjects/Pic18F4550Test.X'
make[1]: Leaving directory `/home/amartins/MPLABXProjects/Pic18F4550Test.X'
make[2]: *** [dist/default/production/Pic18F4550Test.X.production.cof] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 365ms)
This is weird because libraries are there... Don't no what else I can do.
Alex.
On 20-08-2011 00:56, Raphael Neider wrote:
> Hi,
>
>> Does not -L /usr/share/sdcc/lib/pic16 tells compiler where to get
>> libraries, inclusive the libc18f.lib.
> Yes, but does the file exist? We recently changed the location of the
> installed pic14/pic16 libraries and headers due to licence issues. That's
> why I wrote "updated path to sdcc's pic16 libs": they moved from your path
> /usr/share/sdcc/lib/pic16 to /usr/share/sdcc/non-free/lib/pic16 .
> Please verify that /usr/share/sdcc/non-free/lib/pic16/libc18f.lib exists.
>
>> Still gives me same error. I add --use-non-free, but still the same. Do
>> you think something went wrong during build?
> I misinterpreted the error output: The failing command is not "sdcc -c
> main.c -o main.o" (I overlooked the -c) but the link command:
>
>>>> mkdir -p dist/default/production
>>>> /usr/local/bin/sdcc --debug-ralloc -Wl-c -Wl-m --pstack-model=large
>>>> --pno-banksel --extended --obanksel=2 -L /usr/share/sdcc/lib/pic16 -L
>>>> /usr/share/sdcc/lib/small -I/usr/share/sdcc/include
>>>> -I/usr/share/sdcc/include/pic16/ -mpic16 -p18f4550
>>>> build/default/production/main.o
>>>> -odist/default/production/Pic18F4550Test.X.production.cof
>>>> make[2]: *** [dist/default/production/Pic18F4550Test.X.production.cof]
>>>> Error 1
>>>> error: missing definition for symbol "_strcpy", required by
>>>> "build/default/production/main.o"
> The problem here is that sdcc does not compile main.c first but only
> invokes the linker. That way, sdcc does *not* add libc18f.lib to the list
> of libraries to link against (there is a #pragma libc present in all
> libc-headers that cause "sdcc main.c -o main.hex" to compile and
> automatically link against libc18f.lib; however, the #pragma is not seen
> when just looking at main.o ...).
> You need to append libc18f.lib to the linker command line. Also make sure
> to either include --use-non-free or the correct -L /path/to/libc18f.lib.
>
> Good luck
>
> 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
------------------------------------------------------------------------------
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