【发布时间】:2014-03-26 10:46:04
【问题描述】:
我正在尝试安装这个 gem,summarize,通过运行:
gem install summarise
我得到错误:
ERROR: Failed to build gem native extension.
...
In file included from article.c:25:
./libots.h:24:10: fatal error: 'glib.h' file not found
但是当我尝试运行时:
brew install glib
我明白了:
glib-2.38.2 already installed
对接下来要尝试什么有什么想法吗?
编辑: 我已经尝试过:
export CPPFLAGS=-I/usr/local/Cellar/glib/2.38.2/include/glib-2.0/
export LDFLAGS=-L/usr/local/Cellar/glib/2.38.2/lib/
export PKG_CONFIG_PATH=/usr/local/Cellar/glib/2.38.2/lib/pkgconfig/
...这似乎让我可以继续一个新的错误:
compiling article.c
article.c:107:37: warning: passing 'const unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
if ((aWord == NULL) || (0==strlen(aWord)) ||(NULL==aLine)) return;
^~~~~
/usr/include/string.h:82:28: note: passing argument to parameter here
size_t strlen(const char *);
^
article.c:109:68: warning: passing 'const unsigned char *' to parameter of type 'const gchar *' (aka 'const char *') converts between pointers to integer types with different sign [-Wpointer-sign]
aLine->words = g_list_append (aLine->words, (gpointer) g_strdup (aWord));
^~~~~
/usr/local/Cellar/glib/2.38.2/include/glib-2.0/glib/gstrfuncs.h:216:52: note: passing argument to parameter 'str' here
gchar* g_strdup (const char *str) G_GNUC_MALLOC;
...
dictionary.c:28:10: fatal error: 'libxml/xmlmemory.h' file not found
#include <libxml/xmlmemory.h>
【问题讨论】:
标签: ruby macos gem homebrew glib