Re: [anjuta-list] anjuta 3.2.2 won't use libstrl
- From: Sébastien Granjoux <seb sfo free fr>
- To: dbishop bish0p org
- Cc: anjuta-list gnome org
- Subject: Re: [anjuta-list] anjuta 3.2.2 won't use libstrl
- Date: Sun, 12 Feb 2012 12:17:48 +0100
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]