Hello All,
Problem: I cannot compile and link libsdcc.lib or my own created library to my program.
Background details: I am trying to write a program to target for the pic16f628 chip. I am using to compile the program prog1.c I am using SDCC under cygwin. I am using the latest nightly build 24 June 2006.
Progress so far:
- The basic program works and compiles properly using sdcc.
'sdcc -mpic14 -p16f628 prog1.c'
Works fine!!!!
- I try to enhance the program by adding an array. To compile the program, sdcc now require _mulint.o to link it.
'sdcc -mpic14 -p16f628 prog1.c'
This returns: warning: processor mismatch in "_mulint.o"
- After some research I find that it is available in libsdcc.lib.
- I attempt to compile using this and it comes up with
warning: processor mismatch in "_mulint.o"
- Fine, so I know that the default libsdcc.lib is targetted for a different processor. I attempt to include a library path pointing to the correct lib file.
On my system it's
'sdcc -mpic14 -p16f628 prog1.c libsdcc.lib
-L/usr/local/share/sdcc/lib/pic'
It returns with the same error message.
- I attempt to try again using the absolute path:
'sdcc -mpic14 -p16f628 prog1.c /usr/local/share/sdcc/lib/pic/libsdcc'
&'sdcc -mpic14 -p16f628 prog1.c /usr/local/share/sdcc/lib/pic/libsdcc
-L/usr/local/share/sdcc/lib/pic'
Still returns processor mismatch!!!!
- RTFM TIME!!!!! Okay, I read the manual and it describes a way to build a library. I find the correct source of the code for the pic and build a new library using
'sdcc -c _xxx.c'
and adding it to the libray
'libint.lib' (used to differentiate from the exisiting library).
I now get the error - error: "/usr/local/share/sdcc/lib/src/pic/libsdcc/libint.lib" is not a valid coff object or archive
Looking at the asm, it has not generated the right code so I comple and add to the library again now compiling with 'sdcc -c -mpic14 _xxx.c'
I get the same error.....
- RTFM TIME!!!!! Okay, I read the manual and it describes a way to build a library. I find the correct source of the code for the pic and build a new library using
'sdcc -c _xxx.c'
and adding it to the libray
'libint.lib' (used to differentiate from the exisiting library).
I now get the error - error: "/usr/local/share/sdcc/lib/src/pic/libsdcc/libint.lib" is not a valid coff object or archive
I'm at the end of my tether on this, this is basic!
Can anyone help me with how to compile and link using either libsdcc.lib or my own library? This is basic and I'm having so many problems. I have tried almost everything, but this is not working. I'm sure that it is something simple to solve.
Many thanks in advance,
Richard