相关疑难解决方法(0)

C和C++中的标准头文件列表

我在哪里可以找到C和C++中所有头文件的列表?

当我正在构建一个库时,我收到的错误就像' tree.h not found'.我想这是C和C++中的标准头文件.这让我了解了所有头文件及其贡献的好奇心.

我有搜索的地方吗?

我正在使用Solaris Unix.

c c++ header-files

41
推荐指数
4
解决办法
7万
查看次数

如何确保我的默认 C/C++ 编译器是 GCC

我正在尝试在 macOS 上从源代码安装 Riak ( https://docs.riak.com/riak/kv/2.2.3/setup/installing/mac-osx.1.html#installing-from-source )。

有一个注释:

Riak 不会使用 Clang 进行编译。请确保您的默认 C/C++ 编译器是 GCC

如何找出默认编译器以及如何更改它?

macOS Catalina (10.15.4),命令打印:

$ which clang
/usr/bin/clang
$ which gcc
/usr/bin/gcc
Run Code Online (Sandbox Code Playgroud)

c++ macos gcc clang riak

8
推荐指数
1
解决办法
2万
查看次数

GCC无法找到GMP,MPFR和MPC库

我试图在Mac OS 10.5.7上交叉编译GCC.我在安装GMP,MPFR和MPC后使用此命令配置GCC:

../gcc-4.5.0/configure --target=$i586-elf --prefix=/usr/local/cross \
    --disable-nls \
    --enable-languages=c,c++,fortran,java,objc,obj-c++,treelang,ada \
    --without-headers --with-libiconv-prefix=/opt/local --with-gmp=/usr/local \
    --with-mpfr=/usr/local --with-mpc=/usr/local
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误:

checking for the correct version of gmp.h... buggy but acceptable
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for …
Run Code Online (Sandbox Code Playgroud)

configuration gcc makefile mpfr gmp

7
推荐指数
2
解决办法
3万
查看次数

为什么 GCC 9.1.0 有时会抱怨 strncpy() 的这种用法?

这是一个 40 行的 MCVE(最小的、完整的、可验证的示例)——或接近最小的——从最初包含 32 个头文件的 1675 行源文件(其中大部分包含多个其他头文件——用gcc -H列表 464编译它)来自项目和系统的标题,其中许多是多次)。该文件是以前在没有警告的情况下编译的工作代码(GCC 8.3.0),但不是使用 GCC 9.1.0。所有结构、函数、类型、变量名称都已更改。

pf31.c

#include <string.h>

enum { SERVERNAME_LEN = 128 };

typedef struct ServerQueue
{
    char server_name[SERVERNAME_LEN + 1];
    struct ServerQueue *next;
} ServerQueue;

extern int function_under_test(char *servername);

#ifdef SUPPRESS_BUG
extern int function_using_name(char *name);
#endif /* SUPPRESS_BUG */

extern int GetServerQueue(const char *servername, ServerQueue *queue);

int
function_under_test(char *servername)
{
    ServerQueue queue;
    char name[SERVERNAME_LEN + 1];

    if (GetServerQueue(servername, &queue) != 0)
        return -1;
    char *name_in_queue = …
Run Code Online (Sandbox Code Playgroud)

c gcc

6
推荐指数
1
解决办法
2591
查看次数

标签 统计

gcc ×3

c ×2

c++ ×2

clang ×1

configuration ×1

gmp ×1

header-files ×1

macos ×1

makefile ×1

mpfr ×1

riak ×1