【发布时间】:2016-03-16 05:31:57
【问题描述】:
我在安装了 python3 的 Ubuntu 14.04 机器上。在 make 文件中,我的标志如下所示:
CFLAGS = -Wall -std=c11 -g -DNDEBUG `pkg-config --cflags python3`
运行 make 文件时出现错误:
gcc -Wall -std=c11 -g -DNDEBUG `pkg-config --cflags python3` -fPIC -c -o calmodule.o calmodule.c
Package python3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `python3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'python3' found
gcc -shared calmodule.o calutil.o -o Cal.so
我检查了 pkg-config 文件夹,并没有在其中找到 python:
% la /usr/lib/pkgconfig
total 20K
-rw-r--r-- 1 root root 288 Jul 22 2015 dbus-python.pc
-rw-r--r-- 1 root root 452 Jul 22 2015 ibus-table.pc
-rw-r--r-- 1 root root 245 Jul 12 2014 libquvi-scripts.pc
-rw-r--r-- 1 root root 379 Jul 10 2014 pm-utils.pc
-rw-r--r-- 1 root root 366 Sep 30 08:02 valgrind.pc
那里不应该有一个python3.pc 文件吗?或者至少是一个特定的,比如python3.4.pc?
还是我在这里做错了什么?
【问题讨论】:
-
试试
pkg-config --list-all | grep ^python -
@falsetru 没有结果。不包括 grep ,这是一个相当短的列表,我也可以手动查看没有结果。我确实安装了 python 2 和 python 3,但什么也没安装。它们是通过
apt-get安装的。我的python3 --version输出给了我:Python 3.4.3+
标签: python c makefile pkg-config