xmap: Error: Failed to find library

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
BeauWebber
Member++
Posts: 17
Joined: Thu Sep 27, 2012 11:41 pm

xmap: Error: Failed to find library

Post by BeauWebber »

Hi,
I have followed the instructions in :
Using XMOS makefiles to create binary libraries
(Support Development Tools Supported Tools Version: 11.11)

and appear to have successfully built library "libaplc.a" from .c source files.

However when I try to use the library in another project "Add_aplc", it is not found :

Code: Select all

**** Build of configuration Debug for project Add_aplc ****

xmake CONFIG=Debug all 
"Updating eclipse config"
No modules used.
cd ./.build_Debug && xcc -target="XC-1A" -l aplc   ..\.\.build_Debug\src\add.c.o ..\.\.build_Debug\src\Add_aplc.xc.o   -o "..\bin\Debug\Add_aplc_Debug.xe"
xmap: Error: Failed to find library "libaplc.a".
xmake[1]: *** [bin/Debug/Add_aplc_Debug.xe] Error 1
xmake: *** [bin/Debug/Add_aplc_Debug.xe] Error 2
I have specified Xmap flags

Code: Select all

-l aplc
, and it appears to be building the correct library name,
I have placed the library in both Add_aplc/lib and the Add_aplc/src files and specified lib and src in the library directive. But it is still not found.

Can anyone suggest what I am doing wrong ?
cheers,
Beau


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

You can use the -L option to add a library search path
User avatar
BeauWebber
Member++
Posts: 17
Joined: Thu Sep 27, 2012 11:41 pm

Post by BeauWebber »

Bianco wrote:You can use the -L option to add a library search path
Strange, yes, using "lib" in the graphical makefile library box seemed to be doing just that, when I looked at the Makefile.
But putting

Code: Select all

-L lib -l aplc 
as the Mapper (linker) flags now works fine.
Thanks.
User avatar
BeauWebber
Member++
Posts: 17
Joined: Thu Sep 27, 2012 11:41 pm

Post by BeauWebber »

BeauWebber wrote: But putting

Code: Select all

-L lib -l aplc 
as the Mapper (linker) flags now works fine.
Ah, no it does not.
As a hack, I had just placed a copy of the library in the system lib :
C:\Applications\XMOS\11.11.1\target\lib\xs1b
and this was being found OK.
For the above test I re-named this system copy, but the rename had failed and it was still there, and was hence found.
With the libaplc.a not in the system lib, it is not found by the above flags, instead I have to give the full path :

Code: Select all

-L D:\home\jbww\Design\XMOS\Eclipse_v1\Add_aplc\lib -l aplc
cheers,
Beau