External library linkage

Forum related to the FLEX boards

Moderator: paolo.gai

Locked
markintosh
Newbie
Posts: 7
Joined: Mon Oct 27, 2008 5:05 pm

External library linkage

Post by markintosh » Thu Oct 30, 2008 12:09 pm

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: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:External library linkage

Post by paolo.gai » Thu Oct 30, 2008 9:42 pm

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
Newbie
Posts: 7
Joined: Mon Oct 27, 2008 5:05 pm

Re:External library linkage

Post by markintosh » Fri Oct 31, 2008 3:52 pm

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: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:External library linkage

Post by paolo.gai » Sat Nov 01, 2008 8:45 am

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
Newbie
Posts: 15
Joined: Thu Sep 04, 2008 1:14 pm

Re:External library linkage

Post by nino » Fri Nov 07, 2008 3:50 pm

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

Nino

Locked