dequis / purple-facebook

Facebook protocol plugin for libpurple (moved from jgeboski/purple-facebook)
GNU General Public License v2.0
954 stars 88 forks source link

util.h Not Found when the installation prefix is /usr/local #203

Open GhostValk opened 8 years ago

GhostValk commented 8 years ago

I'm trying to compile the plugin, but i'm getting an error. After autogen or configure, when doing make, i get:

Making all in pidgin/libpurple/protocols/facebook
  CC       libfacebook_la-api.lo
In file included from api.c:28:
In file included from ./api.h:41:
In file included from ./id.h:37:
./util.h:36:10: fatal error: 'libpurple/util.h' file not found
#include <libpurple/util.h>
         ^
1 error generated.
make[1]: *** [libfacebook_la-api.lo] Error 1
make: *** [all-recursive] Error 1

Any advice?

dequis commented 8 years ago

https://github.com/jgeboski/purple-facebook/wiki/Building-on-*NIX

Make sure glib, json-glib, libpurple (pidgin), and zlib are installed with their headers and development information.

Install libpurple-dev or the equivalent for your distro

GhostValk commented 8 years ago

Got glib, json-glib, and installed pidgin; tried both with and without gui (OSX), but it's always the same error.. I assume libpurple comes with pidgin, right?

I compiled this plugin some time ago and used it for about a year, now i deleted it by mistake and can't compile it again, don't know why =/

EionRobb commented 8 years ago

As of what point did the purple headers get a subfolder?

GhostValk commented 8 years ago

Purple libraries are installed in libpurple folder inside /usr/local/include

Still can't compile it, same error all the time, even if i input the headers with -I...

jgeboski commented 8 years ago

This is because of the way the plugin handles header naming conflicts. We have a local util.h as well as a libpurple/util.h, which means the plugin is assuming libpurple/*.h is accessible. While this is the case most of the time, it is not guaranteed, which is why things like pkg-config are helpful. However, purple.pc only defines -I${prefix}/include/libpurple, and not -I${prefix}/include (which is a good thing).

What really needs to happen is for this plugin to rename some of its headers to avoid conflicting with libpurple headers. I meant to do this two or three weeks ago, but never ended up getting around to doing it.

In the mean time, see if this works as a temporary solution:

CFLAGS="-I/usr/local/include" ./autogen.sh
make

Edit: Fixed the CFLAGS.

dequis commented 8 years ago

CFLAGS="-I/usr/include/libpurple" ./autogen.sh

Shouldn't that be this? CFLAGS="-I/usr/local/include" ./autogen.sh

jgeboski commented 8 years ago

Yep, good catch.