【问题标题】:Using Clang With Musl将 Clang 与 Musl 一起使用
【发布时间】:2022-11-14 18:17:13
【问题描述】:

我正在使用 Linux。我通过存储库安装了 Clang 编译器和 Musl 标准 C 库。我尝试使用 Musl stdio.h 通过 Clang 编译一个“hello world”程序,但它失败了。

I put the following line at the beginning of the program:

#include </usr/include/x86_64-linux-musl/stdio.h>

But at the compiling time (in verbose mode) it returned the following error:

==============================

(...)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/llvm-11/lib/clang/11.0.1/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
In file included from /home/pureos/hello.c:1:
/usr/include/x86_64-linux-musl/stdio.h:26:10: error: 'bits/alltypes.h' file not found with <angled> include; use "quotes" instead
#include <bits/alltypes.h>
         ^~~~~~~~~~~~~~~~~
         "bits/alltypes.h"

==============================

It appears that it doesn't recognize the "bits" directory inside the "x86_64-linux-musl" directory, but I saw that it DOES exist.

Any help is welcome, regards.

【问题讨论】:

    标签: c clang musl


    【解决方案1】:

    它似乎无法识别“x86_64-linux-musl”目录中的“bits”目录......

    Preprocessor Options;你至少需要-I/usr/include/x86_64-linux-musl。还有更多Include path management 选项。

    【讨论】:

      猜你喜欢
      • 2020-05-10
      • 2021-01-19
      • 1970-01-01
      • 2011-06-08
      • 1970-01-01
      • 1970-01-01
      • 2010-12-15
      • 2017-07-28
      相关资源
      最近更新 更多