我正在尝试在 Ubuntu 12.04 上安装libsmtp,并且在编译时出现错误,这是我遵循的步骤(它们与 Install.txt 文件中编写的完全相同)
cd libsmtp
./configure
[上述命令的输出是]
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for main in -lglib... no
checking for main in -lglib... (cached) no
checking how to run the C preprocessor... gcc -E
列表还在继续,但安装了剩余的依赖项。从输出可以看出,它找不到'lglib',但它实际安装了,modversion的输出是:
usama@ubuntu:~/Desktop/smtp/libsmtp-0.8.5$ pkg-config --modversion glib-2.0
2.32.3
因此,我在运行“make”时出错,输出如下:
usama@ubuntu:~/Desktop/smtp/libsmtp-0.8.5$ make
make[1]: Entering directory `/home/usama/Desktop/smtp/libsmtp-0.8.5/smtp'
gcc -I. -I../include `glib-config --cflags` -g -O2 -DUSE_MIME -c -o libsmtp_comm.o libsmtp_comm.c
/bin/sh: 1: glib-config: not found
libsmtp_comm.c:28:20: fatal error: glib.h: No such file or directory
compilation terminated.
make[1]: *** [libsmtp_comm.o] Error 1
make[1]: Leaving directory `/home/usama/Desktop/smtp/libsmtp-0.8.5/smtp'
make: *** [all] Error 1
谁能告诉如何解决这个问题?
更新:
处理 glib 的配置脚本部分是:
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_glib_main=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_glib_main=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_glib_main" >&5
echo "${ECHO_T}$ac_cv_lib_glib_main" >&6
if test $ac_cv_lib_glib_main = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGLIB 1
_ACEOF
LIBS="-lglib $LIBS"
echo "$as_me:$LINENO: checking for main in -lglib" >&5
echo $ECHO_N "checking for main in -lglib... $ECHO_C" >&6
if test "${ac_cv_lib_glib_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lglib $LIBS"