External library file not found during linking

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi

   

I am trying to use a library called ezPSocLib. I put the compiled library in the linker path but for some reason the linker does not see this file at all.

   

I have attached the project.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The library should be named libezPSoC. The preceded "lib" must be omitted when telling GCC the library name. So use "ezPSoC" as library name.

   

 

   

Bob

View solution in original post

0 Likes
11 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The library should be named libezPSoC. The preceded "lib" must be omitted when telling GCC the library name. So use "ezPSoC" as library name.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for the help Rob. That error has gone but the compiler still does not see any reference to that library. The error is "undefined reference to xxx. basically any call that I make to a library function. The headers are included in the project.

Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Karius

   

Post your complete project including the library

   

 

   

Bob

0 Likes
Anonymous
Not applicable

See project attached. The library is in the workspace.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Sorry I missed the upload

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Rob please try this one I am sure it is the latest.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Karius, the EZPSoC5 library you specified is not there. Library name must be  "libEZPSoC5.a"

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I see it was not included when I made the zip but it is there. Try this one.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Sorry, can't get it to compile either, looks as if it is a port from C++.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I logged an issue with the creator on github.

   

https://github.com/EagleSoC/EZ-PSoC5_LIB

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

They release a version 1.2 that seems to work fine. The "-lm" directive must just be included on the linker command line.

   

Thanks for the help Rob.

0 Likes