在编译期间找不到pkg-config:命令,但安装了pkg-config

时间:2016-03-06 22:46:15

标签: c macos pkg-config guile

更新:我开始工作,问题与我通过emacs运行它的事实有关。我改为从命令行运行makefile,然后运行pkg-config。将export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig添加到guile-2.0.pc的路径后,编译完所有内容并运行正常。仍然不会通过emacs编译,但我不想处理。

我正在尝试编译C程序但收到“pkg-config:command not found”错误,但我很确定已安装pkg-config。

以下是MAKEFILE

# Use GCC, if you have it installed.
CC=gcc

# Tell the C compiler where to find <libguile.h>
CFLAGS=`pkg-config --cflags guile-2.0`

# Tell the linker what libraries to use and where to find them.
LIBS=`pkg-config --libs guile-2.0`

simple-guile: simple-guile.o
${CC} simple-guile.o ${LIBS} -o simple-guile

simple-guile.o: test.c
${CC} -c ${CFLAGS} test.c

下面是错误消息(re:第二个错误,我想如果我能解决这个问题,将找到libguile.h文件)

make 
gcc -c `pkg-config --cflags guile-2.0` test.c
/bin/sh: pkg-config: command not found
test.c:2:11: fatal error: 'libguile.h' file not found
 #include <libguile.h> 
      ^
1 error generated.
make: *** [simple-guile.o] Error 1    

我通过

安装了pkg-config
brew install pkg-config

安装是否成功?...

Jeffs-iMac:~ Jeff$ which pkg-config
/opt/local/bin/pkg-config

如果相关,则应该与guile所在的目录相同:

Jeffs-iMac:~ Jeff$ which guile
/opt/local/bin/guile

使用OS X 10.11.3

我尝试卸载并重新安装pkg-config per:Can't install rmagick, pkg-config: command not found

我是一名新手程序员,非常感谢任何帮助。

0 个答案:

没有答案
相关问题