“致命错误:bits/libc-header-start.h:没有这样的文件或目录"在编译HTK时 [英] "fatal error: bits/libc-header-start.h: No such file or directory" while compiling HTK

查看:1173
本文介绍了“致命错误:bits/libc-header-start.h:没有这样的文件或目录"在编译HTK时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在make时遇到以下问题> HTK库:

I'm getting the following issue when trying to run make on the HTK library:

(cd HTKLib && make HTKLib.a) \
  || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory '/home/william/speech/htk/HTK-3.4.1/htk/HTKLib'
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HGraf.o HGraf.c
In file included from HShell.h:40:0,
                 from HGraf.c:54:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
 #include <bits/libc-header-start.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'HGraf.o' failed
make[1]: *** [HGraf.o] Error 1
make[1]: Leaving directory '/home/william/speech/htk/HTK-3.4.1/htk/HTKLib'
Makefile:96: recipe for target 'HTKLib/HTKLib.a' failed
make: *** [HTKLib/HTKLib.a] Error 1

我不确定该怎么办. libc-header-start.h文件在我的系统上存在:

I'm unsure what to do about this error. The libc-header-start.h file is present on my system:

$ find /usr -name libc-header-start.h
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h

运行gcc -H -fsyntax-only /usr/include/stdio.h会正确返回

. /usr/include/x86_64-linux-gnu/bits/libc-header-start.h
.. /usr/include/features.h
... /usr/include/x86_64-linux-gnu/sys/cdefs.h

此外,编译并运行健全性检查C文件也可以正常工作(只需在其main方法中执行printf("hello!");即可).

Also, compiling and running a sanity-check C file works fine (simply executing printf("hello!"); in its main method).

如果这是一个众所周知的错误,我们深表歉意-我对C库的经验不再是使用make进行编译和安装.

Apologies if this is a well-known error - my experience with C libraries stops at compiling and installing them using make.

更新 根据下面接受的答案,我执行了sudo apt-get install gcc-multilib来安装缺少的32位库.

UPDATE Per the accepted answer below I executed sudo apt-get install gcc-multilib to install the missing 32 bit libraries.

之后,我得到了一个错误,原因相似:"/usr/bin/ld: cannot find -lX11" error when installing htk.我通过执行sudo apt-get install libx11-dev:i386 libx11-dev来检索丢失的32位库来解决此问题.

Afterwards I got an error with a similar cause: "/usr/bin/ld: cannot find -lX11" error when installing htk. I resolved this by executing sudo apt-get install libx11-dev:i386 libx11-dev to retrieve the missing 32 bit library.

推荐答案

-m32告诉gcc为32位平台进行编译.在64位计算机上,gcc通常仅随附64位库.您有两种选择:

The -m32 is telling gcc to compile for a 32-bit platform. On a 64-bit machine, gcc normally only comes with 64-bit libraries. You have two options:

  1. 安装32位标头和库.在Ubuntu上执行此操作的方法如下: https://askubuntu.com/questions/91909/trouble-compiling-a-32-bit-binary-on-a-64-bit-machine
  2. 改为编译为64位.在名为configure:

CFLAGS="-m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"

删除-m32,为您提供:

CFLAGS="-ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"

依次运行./configuremake cleanmake

但是,我不建议您这样做.库作者竭尽全力在64位系统上构建32位版本,如果您更改此版本,它可能无法正常工作. (尽管它确实可以编译.)

However, I would not suggest doing this. The library authors went out of their way to make this build for 32 bits on a 64 bit system, and it might not work correctly if you change this. (It does compile, though.)

这篇关于“致命错误:bits/libc-header-start.h:没有这样的文件或目录"在编译HTK时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆