有人能解决这个错误吗?配置 emacs 并运行 make 后,我得到以下信息:
[jroberts@pc emacs-24.3]$ make
make: *** No targets specified and no makefile found. Stop.
这是我运行时的输出./configure
[jroberts@pc emacs-24.3]$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking for ranlib... ranlib
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for gcc option to accept ISO C99... -std=gnu99
checking for gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking whether gcc -std=gnu99 accepts -g3 -O2... yes
checking whether ln -s works... yes
checking for install-info... /usr/sbin/install-info
checking for gzip... /usr/bin/gzip
checking for paxctl... no
checking for makeinfo... no
checking for -znocombreloc... yes
checking for pkg-config... /usr/bin/pkg-config
checking machine/soundcard.h usability... no
checking machine/soundcard.h presence... no
checking for machine/soundcard.h... no
checking sys/soundcard.h usability... yes
checking sys/soundcard.h presence... yes
checking for sys/soundcard.h... yes
checking soundcard.h usability... no
checking soundcard.h presence... no
checking for soundcard.h... no
checking for _oss_ioctl in -lossaudio... no
checking for alsa >= 1.0.0... no
checking for linux/version.h... yes
checking for sys/systeminfo.h... no
checking for stdio_ext.h... yes
checking for fcntl.h... yes
checking for coff.h... no
checking for pty.h... yes
checking for sys/vlimit.h... yes
checking for sys/resource.h... yes
checking for sys/utsname.h... yes
checking for pwd.h... yes
checking for utmp.h... yes
checking for dirent.h... yes
checking for util.h... no
checking for sys/socket.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for pthread.h... yes
checking for malloc/malloc.h... no
checking for maillock.h... no
checking for sys/un.h... yes
checking for execinfo.h... yes
checking for getopt.h... yes
checking for sys/time.h... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for sys/select.h... yes
checking for sys/stat.h... (cached) yes
checking for utime.h... yes
checking if personality LINUX32 can be set... yes
checking for term.h... no
checking whether time.h and sys/time.h may both be included... yes
checking whether sys_siglist is declared... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for speed_t... yes
checking for net/if.h... yes
checking for ifaddrs.h... yes
checking for net/if_dl.h... no
checking for struct ifreq.ifr_flags... yes
checking for struct ifreq.ifr_hwaddr... yes
checking for struct ifreq.ifr_netmask... yes
checking for struct ifreq.ifr_broadaddr... yes
checking for struct ifreq.ifr_addr... yes
checking for struct ifreq.ifr_addr.sa_len... no
checking whether we are using GNU Make... yes
checking whether gcc understands -MMD -MF... yes
checking for long file names... yes
checking for X... libraries , headers
checking whether malloc is Doug Lea style... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for dnet_ntoa in -ldnet... no
checking for main in -lXbsd... no
checking for pthread_self in -lpthread... yes
checking for cma_open in -lpthreads... no
checking whether X on GNU/Linux needs -b to link... no
checking for Xkb... yes
checking for XrmSetDatabase... yes
checking for XScreenResourceString... yes
checking for XScreenNumberOfScreen... yes
checking X11 version 6... 6 or newer
checking for librsvg-2.0 >= 2.11.0... no
checking for Wand >= 6.2.8... no
checking for gtk+-3.0 >= 3.0 glib-2.0 >= 2.28... no
checking for gtk+-2.0 >= 2.10 glib-2.0 >= 2.10... no
checking for dbus-1 >= 1.0... no
checking for gio-2.0 >= 2.26... no
checking for gconf-2.0 >= 2.13... no
checking for lgetfilecon in -lselinux... no
checking for gnutls >= 2.6.6... no
checking for gnutls_certificate_set_verify_function... no
checking for xaw3d... no
checking for libXaw... configure: error: No X toolkit could be found.
If you are sure you want Emacs compiled without an X toolkit, pass
--with-x-toolkit=no
to configure. Otherwise, install the development libraries for the toolkit
that you want to use (e.g. Gtk+) and re-run configure.
这确实生成了一个 makefile,但它不起作用。有什么建议吗?
答案1
仔细查看问题中的输出文件:
[ ... ]
checking for lgetfilecon in -lselinux... no
checking for gnutls >= 2.6.6... no
checking for gnutls_certificate_set_verify_function... no
checking for xaw3d... no
checking for libXaw...
configure: error: No X toolkit could be found
。
If you are
sure you want Emacs compiled without an X toolkit, pass --with-x-toolkit=no
to configure. Otherwise,
install the development libraries
for the toolkit
that you want to use (e.g. Gtk+) and
re-run configure
。
所以它停了下来,并要求你选择:
- 要么你决定只构建一个文本模式的程序。但是,你需要明确地告诉 configure。
运行它:
./configure --with-x-toolkit=no
请注意,即使您不想使用 GUI 功能,构建 X
支持也是不错的选择,因为系统剪贴板由 X 处理,您可能需要访问它。
或者你提供一些 GUI 库、X11 工具包等;
很可能你需要安装一些 X 开发包。
根据 如果我想编译 Emacs,需要安装哪些库?,
尝试安装这组软件包 - 您可能已经拥有其中的大部分。一行代码即可:
sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev automake autoconf
你想自己编译 emacs,但如果你只想安装它,Ubuntu 有版本 24.3,带或不带 X:apt-get install emacs24
或者带emacs24-nox
答案2
您应该安装 GTK+ 的开发库。最好针对 GTK+ 3 而不是旧版本 GTK+ 2 来编译 Emacs。
$ sudo apt-get install libgtk-3-dev
答案3
尝试安装 DDD 期间,我在配置命令时遇到错误:
The X toolkit library '-lXt' could not be found.
经过一番搜索后,我找到了一个适合我的解决方案:
yum install openmotif
或者apt-get install libmotif-dev
然后来自 configure 命令的错误消息就消失了。
虽然我不完全确定这个解决方案如何工作,但我希望它可以帮助遇到类似问题的其他人。