Re: [anjuta-list] anjuta 3.2.2 won't use libstrl



Hi Sébastien

I had similar thoughts, and have tried various combinations -- so many that I was starting to confuse myself!

I was able to use libbsd which is essentially similar to libstrl.  I only had to add the header file reference into my source (#include <bsd/string.h> and nothing else.  It worked without any other changes anywhere. 

I think the issue is that the linker can't find the library object file or some related error.  Not sure why. 

We'll keep trying :-)  I think that since I can use the BSD compatibily version, I'm okay for now, but you guys should be aware of this.

I really like Anjuta, what a great IDE.  And you know how much Gentoo (and Funtoo) people like compiling things!

thanks,
Don B

On Sun, 2012-02-12 at 12:17 +0100, Sébastien Granjoux wrote:
Hi,


Le 11/02/2012 22:44, Don Bish0p a écrit :
> I'm using Gentoo Linux and have just installed libstrl-0.5.1 and using
> Anjuta 3.2.2. I have used Project>Add Library>New Library and selected
> 'libstrl ' from the package list. It shows up as module in my "Project"
> pane. However I keep getting
> /home/dbishop/pathloss-cpp/src/loadfiles.cxx:92: undefined reference to
> `strlcpy(char*, char const*, unsigned long)' messages. I had this
> trouble when I tried to use libbz2 but I was able to get around it by
> adding -lbz2 to the linker flags (in the Project>Properties dialog). I
> added -lstrl but that didn't help either. That dialog does show
> $(LIBSTRL_LIBS) in the Libraries: field.
>
> Any ideas what I am doing wrong, or what I should check for?

It seems that you do the right thing.

I think you could have an issue because the source is in C++. You have 
to tell to the C++ compiler that it's a C function.

I think it can be done by using the header file of the library (I 
suppose #include <strl.h>) which should declare all functions within 
"extern "C" {" and "}" to indicate that all these are C functions. If 
it's not done you can do it yourself.

To check you can just add the following line in loadfiles.cxx and try to 
build your program.
"extern "C" size_t strlcpy(char *dst, const char *src, size_t len);"


Else, you have $(LIBSTRL_LIBS) in the library field of your target so it 
looks fine. You can check LIBSTRL_LIBS in the makefile generated by 
autotools, it should be equal to -lstrl or something similar.

When a library isn't provided as a package, you need to add 
-l_library_name to the linker flags. I think it's the case foe libbz2.


Regards,

Sébastien




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]