External library linkage

Forum related to the FLEX boards

Moderator: paolo.gai

Locked
markintosh

External library linkage

Post 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
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re:External library linkage

Post 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
markintosh

Re:External library linkage

Post 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
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re:External library linkage

Post 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
nino

Re:External library linkage

Post by nino »

Be careful! If you selected the Microchip compiler inside Eclipse you need to use coff complied libraries.

Nino
Locked