chipKIT® Development Platform

Inspired by Arduino™

How to link libXXX.a in platforms.txt

Created Thu, 31 Jan 2013 10:49:01 +0000 by kyab212


Thu, 31 Jan 2013 10:49:01 +0000

I have libFoo.a and want to link with my sketch. But how can I do ?

I've tried to add library path to pic32.library.path and specify -lFoo in pic32.compiler.c.elf.flags in platforms.txt, but It does not work.

any advice?


Fri, 01 Feb 2013 15:52:19 +0000

I solved by myself.

At first, in my case libfoo.a was compiled as C(not C++), so I should include with extern "C" in my sketch.

extern "C"{
 #include "foo.h"

then, in platforms.txt, I changed as below lines.


libfoo.a is located on /dir/of/libfoo/lib and headers are located on /dir/of/libfoo/include.

After reboot MPIDE, I succeeded to build my sketch!