Page 1 of 1

External library linkage

Posted: Thu Oct 30, 2008 12:09 pm
by markintosh
Hi to all, I\'d like to use the DSP library\'s functions can someone give me a hint? Do I have to insert in the conf.oil the linking to the external library provided by Microchip (the libdsp-coff.a)?
Cheers, MARCO

Re:External library linkage

Posted: Thu Oct 30, 2008 9:42 pm
by paolo.gai
Yes... exactly that. In particular, You can use the various OIL attributes like CFLAGS, LDFLAGS, and so on to pass specific compiler options.

Ciao,

PJ

Re:External library linkage

Posted: Fri Oct 31, 2008 3:52 pm
by markintosh
I think probably I can\'t set the .oil file in the right way because I still a missing library error on compile time. I\'m trying to use the math and the dsp library. My .oil file contains the following attributes:

Code: Select all


...
OS myOs {
    EE_OPT = \"DEBUG\";
    LDFLAGS = \"-LC:/Programmi/Microchip/MPLAB_C30/lib\";
    LIBS = \"-llibc-elf.a\";
    LIBS = \"-llibdsp-elf.a\";
    CPU_DATA = PIC30 { 
....
and the source file contains this preprocessor directives

Code: Select all


...
#include \"stdlib.h\"  
#include \"math.h\"
...
Do I have to use the path of the math.h and of the dsp.h header file? doing in this way I got some errors with others unfound headers used by these libraries (such as yvals.h). I already read the oil specification but I didn\'t find anything more to use. cheers, MARCO

Re:External library linkage

Posted: Sat Nov 01, 2008 8:45 am
by paolo.gai
Hi,

The CFLAGS, LDFLAGS, ... values are put directly into the PIC30 GCC command line.

If you have a working example under MPLAB IDE, then when you compile from MPLAB IDE you can see the command line executed. From these lines, copy the commands you need, and put them back to the OIL file.

Then, in the OIL fila, just add

EE_OPT = \" VERBOSE \";

to get the real commands executed when compiling, and check if they are equal to the ones you had into the MPLAB.

(When done, post the result on the forum, so that we can create a wiki page for the next one who asks it :-) )

PJ

Re:External library linkage

Posted: Fri Nov 07, 2008 3:50 pm
by nino
Be careful! If you selected the Microchip compiler inside Eclipse you need to use coff complied libraries.

Nino