35.如何使用conan包


欢迎访问个人网络日志🌹🌹知行空间🌹🌹


conan使用指南

使用conan 包

下载示例工程

$ git clone https://github.com/conan-io/examples2.git
$ cd examples2/tutorial/consuming_packages/simple_cmake_project

上述工程会依赖zlib, 在使用conan管理包的时候,会从ConanCente中拉取需要的包,上述工程中包含conanfile.txt就是为了说明需要获取的conan包的版本信息。

[requires]
zlib/1.2.11

[generators]
CMakeDeps
CMakeToolchain

上面文件中,[generators]这一部分定义了 Conan 应该使用的生成器。生成器是 Conan 的一个组件,它负责生成构建系统所需的文件。CMakeDeps:这是一个生成器,它会生成一个 conan_cmake_find_package.cmake 文件,这个文件可以用来在 CMake 项目中查找 Conan 管理的包。CMakeToolchain:这是另一个生成器,它会生成一个 conan_toolchain.cmake 文件,这个文件包含了构建项目所需的工具链配置,比如编译器设置、CMake 版本等。

conan profile detect --force

上面的命令用来创建或更新一个 Conan 用户配置文件(profile),这个文件包含了构建环境的设置,如编译器、架构、操作系统等信息。

detect_api: Found cc=gcc- 13.2.0
detect_api: gcc>=5, using the major as version
detect_api: gcc C++ standard library: libstdc++11

Detected profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

WARN: This profile is a guess of your environment, please check it.
WARN: The output of this command is not guaranteed to be stable and can change in future Conan versions.
WARN: Use your own profile files for stability.
Saving detected profile to /home/lx/.conan2/profiles/default

可以使用如下命令获取conan的配置文件默认的路径,

conan config home
# /home/lx/.conan2

profile文件中包含不同的部分,[settings]包含了操作系统、体系结构、编译器和构建的配置,当使用conan指令带--profile参数时,相关的配置将都会从profile文件中读取,当不指定这个参数的时候,默认的会从--profile=default中读取。可以使用不同的profile文件来配置不同的构建设置。在conan命令中使用--settings参数可以覆盖掉profile中的setting设置。可以使用如下代码来确认setting参数有没有生效,

#include <cstdio>

int main() {
#ifdef NDEBUG
    printf("Not debug\n");
#else
    prinf("debug\n");
#endif

    return 0;
}

编译的时候使用的参数如下:

conan install . --output-folder=build --build=missing --settings=build_type=Debug

接下来将使用 Conan 安装 Zlib 并生成 CMake 所需的文件来查找该库并构建我们的项目。我们将在文件夹 build 中生成这些文件。为此,请运行:

conan install . --output-folder=build --build=missing

构建仓库:

cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release

cmake中的CMAKE_TOOLCHAIN_FILE变量非常有用,它允许用户指定一个工具链文件,这个文件定义了构建系统的环境和编译器设置。工具链文件通常用于跨平台构建,或者当你需要自定义编译器、编译选项、链接器等设置时。

将构建工具也作为conan包进行管理

上面的示例中使用的是系统中已经安装的cmake,有时候需要使用conan包来指定要使用的cmake版本,本节就来介绍如何使用conan来安装指定版本的cmake来进行编译系统的构建。

以上操作其实非常简单,只需要在conanfile.txt中进行指定即可,如下:

[requires]
zlib/1.2.11

[tool_requires]
cmake/3.22.6

[generators]
CMakeDeps
CMakeToolchain

在指定cmake‵版本之前,还是需要系统先有一个cmake,因为conanfile中指定的cmake`版本只是指定在当前的工程中。

cmake文件中添加一行打印使用cmake的版本信息:

message("Building with CMake version: ${CMAKE_VERSION}")

执行上述命令后,在build文件夹下将有如下文件conanbuild.sh,这个脚本自动调用VirtualBuildEnv生成器,这个脚本会设置一些环境变量如$PATH来指定我们的软件路径,如新安装的cmake

source conanbuild.sh  # 激活当前环境
cmake --version
# cmake version 3.22.6

同样在build文件夹中还有deactivate_conanbuild.sh文件用来恢复系统环境变量的设置,

source deactivate_conanbuild.sh # 恢复环境变量设置

应用依赖设置

默认情况下,conan生成目标文件使用的是静态链接的方式,通过设置conan--options参数可以设置目标文件是静态链接还是动态链接的方式,

conan install . --output-folder=build --build=missing --options=zlib/1.2.11:shared=True

使用上述命令的时候会在build目录下生成‵conanrun.sh脚本设置VirtualRunEnv环境相关的变量,如LD_LIBRARY_PATHPATH`,供执行可执行文件的时候使用,如执行共享库的路径。

conan中settingsoptions的区别:

  • settings 是项目范围的配置,会影响正在构建的整个项目。例如,操作系统(os)、架构(arch)和编译器(compiler)等设置,对于依赖关系图中的所有包来说,这些设置通常是相同的。
  • options 是特定于包的配置。例如,静态或共享库不是适用于所有包的设置。有些包可能只包含头文件,而其他包可能包含数据或可执行文件。shared 是一个常见的选项,但包可以定义和使用任何它们需要的选项。

使用conanfile.py

简单场景使用conanfile.txt就足够了,但想更灵活的使用conan就需要使用conanfile.py了,可以在其中使用 Python 代码来执行诸如动态添加需求、根据其他选项更改选项或根据需求设置选项等操作。

将以下conanfile.txt改造成conanfile.py文件:

# conanfile.txt
[requires]
zlib/1.2.11

[tool_requires]
cmake/3.22.6

[generators]
CMakeDeps
CMakeToolchain

改造成的conanfile.py文件如下:

from conan import ConanFile

class CompressorRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeToolchain", "CMakeDeps"

    def requirements(self):
        self.requires("zlib/1.2.11")

    def build_requirements(self):
        self.tool_requires("cmake/3.22.6")

这个类CompressorRecipe继承自ConanFile类,这个类有不同的settings/gennerators配置,

  • requirements()方法中调用self.requires方法来指定zlib依赖
  • build_requirements()方法中使用self.tool_requires()来指定编译工具等的使用

其他的conan build/install指令的使用方式和使用conanfile.txt时一样不要变更。

在前面的示例中,每次执行 conan install 命令时,我们都必须使用 –output-folder 参数来定义要创建 Conan 生成的文件的位置。有一种更简洁的方法来决定我们希望 Conan 在哪里为构建系统生成文件,例如如果我们想要根据我们使用的 CMake 生成器的类型来设置不同的输出文件夹, 可以直接在conanfile.py layout()方法中定义它,并使其适用于每个平台,而无需添加更多更改。

使用layout方法

def layout(self):
    # We make the assumption that if the compiler is msvc the
    # CMake generator is multi-config
    multi = True if self.settings.get_safe("compiler") == "msvc" else False
    if multi:
        self.folders.generators = os.path.join("build", "generators")
        self.folders.build = "build"
    else:
        self.folders.generators = os.path.join("build", str(self.settings.build_type), "generators")
        self.folders.build = os.path.join("build", str(self.settings.build_type))
  • self.folders.generatorslayout()方法中可以通过设置这个属性来指定Conan生成的所有辅助文件(CMake 工具链和 cmake 依赖文件)放置的文件夹

使用validate方法

conan加载conanfile.py文件时,还会自动执行validate函数,可以进行一些配置的校验。

def validate(self):
    if self.settings.os == "Macos" and self.settings.arch == "armv8":
        raise ConanInvalidConfiguration("ARM v8 not supported in Macos")

使用generate()方法从pkg中复制资源

在某些场景中,conan pkg中包含有对使用pkg的人来说十分重要的文件,像配置文件/assert等,使用generate()方法可以将这些文件从conan cache中拷贝到工程文件夹中,确保所有的资源可以被正确的使用。

如下的示例代码功能是将pkg resdirs目录下的资源文件拷贝到工程asserts文件夹下,

import os
from conan import ConanFile
from conan.tools.files import copy

class MyProject(ConanFile):

    ...

    def generate(self):
        # Copy all resources from the dependency's resource directory
        # to the "assets" folder in the source directory of your project
        dep = self.dependencies["dep_name"]
        copy(self, "*", dep.cpp_info.resdirs[0], os.path.join(self.source_folder, "assets"))

执行conan install命令后,所有的资源文件将会被拷贝到本地,如此就可以在本地工程中使用配置文件来构建了。

交叉编译

譬如在x86 64ubuntu上编译,在Raspberry Pi上运行。conan使用两个编译配置文件高的profile,即便对于本地编译运行的conan构建,也可以看做其使用了两套profile,如下:

conan install . --build=missing --profile:host=someprofile --profile:build=default
  • profile:host:这是定义构建的二进制文件将运行的平台的配置文件。对于我们的字符串压缩器应用程序,此配置文件将应用于将在 Raspberry Pi 中运行的 Zlib 库。
  • profile:build:这是定义将构建二进制文件的平台的配置文件。对于我们的字符串压缩器应用程序,CMake 工具将使用此配置文件,该工具将在 Ubuntu Linux 计算机上对其进行编译。

仅设置--profile参数时,等价于设置profile:host--profile:build将使用默认配置。

# build.profile
[settings]
os=Linux
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.version=9

# host.profile
[settings]
os=Linux
arch=armv7hf
compiler=gcc
build_type=Release
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.version=9
[buildenv]
CC=arm-linux-gnueabihf-gcc-9
CXX=arm-linux-gnueabihf-g++-9
LD=arm-linux-gnueabihf-ld

对应的conanfile.py文件内容基本上不变:

from conan import ConanFile
from conan.tools.cmake import cmake_layout

class CompressorRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeToolchain", "CMakeDeps"

    def requirements(self):
        self.requires("zlib/1.2.11")

    def build_requirements(self):
        self.tool_requires("cmake/3.22.6")

    def layout(self):
        cmake_layout(self)

编译使用的命令为:

conan install . --build missing -pr:b=default -pr:h=./profiles/raspberry

使用file命令可以查看编译生成的可执行文件的目标架构是aarch64

reference

使用conan编译报以下错误如何解决: /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:69:10: note: in expansion of macro 'STAT_TIMESPE' 69 | return STAT_TIMESPEC (st, st_atim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_ctime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:82:10: note: in expansion of macro 'STAT_TIMESPE' 82 | return STAT_TIMESPEC (st, st_ctim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_mtime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:95:10: note: in expansion of macro 'STAT_TIMESPE' 95 | return STAT_TIMESPEC (st, st_mtim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_atime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:121:10: note: in expansion of macro 'STAT_TIMESPEC' 121 | return STAT_TIMESPEC (st, st_atim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/careadlinkat.c: In function 'careadlinkat': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_ctime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/careadlinkat.c:178:5: warning: #warning "GCC might issue a bogus -Wreturn-local-addr warning here." [-Wcpp] 178 | #warning "GCC might issue a bogus -Wreturn-local-addr warning here." | ^~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:135:10: note: in expansion of macro 'STAT_TIMESPEC' 135 | return STAT_TIMESPEC (st, st_ctim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/careadlinkat.c:179:5: warning: #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." [-Wcpp] 179 | #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." | ^~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_mtime': gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -m64 -O3 -c -o stat-w32.o /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-w32.c /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:149:10: note: in expansion of macro 'STAT_TIMESPEC' 149 | return STAT_TIMESPEC (st, st_mtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_birthtime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/careadlinkat.c:182:10: warning: function may return address of local variable [-Wreturn-local-addr] 182 | return readlink_stk (fd, filename, buffer, buffer_size, alloc, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 183 | preadlinkat, stack_buf); | ~~~~~~~~~~~~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:167:7: note: in expansion of macro 'STAT_TIMESPE' 167 | t = STAT_TIMESPEC (st, st_birthtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/careadlinkat.c:181:8: note: declared here 181 | char stack_buf[STACK_BUF_SIZE]; | ^~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_dupfree.o `test -f 'malloc/scratch_buffer_dupfree.c' || echo '/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/'`malloc/scratch_buffer_dupfree.c gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_grow.o `test -f 'malloc/scratch_buffer_grow.c' || echo '/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/'`malloc/scratch_buffer_grow.c gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_grow_preserve.o `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/'`malloc/scratch_buffer_grow_preserve.c In file included from /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c:54: /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_atime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:69:10: note: in expansion of macro 'STAT_TIMESPE' 69 | return STAT_TIMESPEC (st, st_atim).tv_nsec; | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_set_array_size.o `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/'`malloc/scratch_buffer_set_array_size.c /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c: At top level: /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_ctime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c:68:1: error: conflicting types for 'rpl_fstat'; have 'int(int, struct _stati64 *)' 68 | rpl_fstat (int fd, struct stat *buf) | ^~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:82:10: note: in expansion of macro 'STAT_TIMESPE' 82 | return STAT_TIMESPEC (st, st_ctim).tv_nsec; | ^~~~~~~~~~~~~ In file included from /usr/include/time.h:158, from ./time.h:47, from /usr/include/sys/stat.h:9, from ./sys/stat.h:32, from /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c:25: ./sys/stat.h:955:1: note: previous declaration of 'rpl_fstat' with type 'int(int, struct _stati64 *)' 955 | _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); | ^~~~~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_mtime_ns': In file included from /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.c:21: /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_atime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c: In function 'rpl_fstat': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:95:10: note: in expansion of macro 'STAT_TIMESPE' 95 | return STAT_TIMESPEC (st, st_mtim).tv_nsec; | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o uniwidth/libicrt_a-width.o `test -f 'uniwidth/width.c' || echo '/c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/'`uniwidth/width.c /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:69:10: note: in expansion of macro 'STAT_TIMESPE' 69 | return STAT_TIMESPEC (st, st_atim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c:92:47: error: passing argument 2 of 'orig_fstat' from incompatible pointer type [-Wincompatible-pointer-types] 92 | return stat_time_normalize (orig_fstat (fd, buf), buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_atime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_ctime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c:35:34: note: expected 'struct stat *' but argument is of type 'struct _stati64 *' 35 | orig_fstat (int fd, struct stat *buf) | ~~~~~~~~~~~~~^~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:121:10: note: in expansion of macro 'STAT_TIMESPEC' 121 | return STAT_TIMESPEC (st, st_atim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:82:10: note: in expansion of macro 'STAT_TIMESPE' 82 | return STAT_TIMESPEC (st, st_ctim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/fstat.c:92:53: error: passing argument 2 of 'stat_time_normalize' from incompatible pointer type [-Wincompatible-pointer-types] 92 | return stat_time_normalize (orig_fstat (fd, buf), buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_ctime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_mtime_ns': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:211:58: note: expected 'struct _stati64 *' but argument is of type 'struct _stati64 *' 211 | stat_time_normalize (int result, _GL_UNUSED struct stat *st) /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:135:10: note: in expansion of macro 'STAT_TIMESPEC' 135 | return STAT_TIMESPEC (st, st_ctim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:95:10: note: in expansion of macro 'STAT_TIMESPE' 95 | return STAT_TIMESPEC (st, st_mtim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_mtime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_atime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:149:10: note: in expansion of macro 'STAT_TIMESPEC' 149 | return STAT_TIMESPEC (st, st_mtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:121:10: note: in expansion of macro 'STAT_TIMESPEC' 121 | return STAT_TIMESPEC (st, st_atim); | ^~~~~~~~~~~~~ make[2]: *** [Makefile:1654: libicrt_a-fstat.o] Error 1 /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_birthtime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_ctime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:167:7: note: in expansion of macro 'STAT_TIMESPE' 167 | t = STAT_TIMESPEC (st, st_birthtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:135:10: note: in expansion of macro 'STAT_TIMESPEC' 135 | return STAT_TIMESPEC (st, st_ctim); | ^~~~~~~~~~~~~ make[2]: *** Waiting for unfinished jobs.... /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_mtime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:149:10: note: in expansion of macro 'STAT_TIMESPEC' 149 | return STAT_TIMESPEC (st, st_mtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h: In function 'get_stat_birthtime': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:167:7: note: in expansion of macro 'STAT_TIMESPE' 167 | t = STAT_TIMESPEC (st, st_birthtim); | ^~~~~~~~~~~~~ make[2]: *** [Makefile:1780: libicrt_a-stat-time.o] Error 1 /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c: At top level: /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c:112:1: error: conflicting types for 'rpl_stat'; have int(const char *, struct _stati64 *)' 112 | rpl_stat (char const *name, struct stat *buf) | ^~~~~~~~ In file included from /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c:51: ./sys/stat.h:1363:18: note: previous declaration of 'rpl_stat' with type 'int(const char * restrict, struct _stati64 * restrict)' 1363 | _GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf) | ^~~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c: In function 'rpl_stat': /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c:420:33: error: passing argument 2 of 'orig_stat' from incompatible pointer type [-Wincompatible-pointer-types] 420 | int result = orig_stat (name, buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c:37:47: note: expected 'struct stat *' but argument is of type 'struct _stati64 *' 37 | orig_stat (const char *filename, struct stat *buf) | ~~~~~~~~~~~~~^~~ /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat.c:436:45: error: passing argument 2 of 'stat_time_normalize' from incompatible pointer type [-Wincompatible-pointer-types] 436 | result = stat_time_normalize (result, buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic5861d38eefb11/b/src/srclib/stat-time.h:211:58: note: expected 'struct _stati64 *' but argument is of type 'struct _stati64 *' 211 | stat_time_normalize (int result, _GL_UNUSED struct stat *st) make[2]: *** [Makefile:1774: libicrt_a-stat.o] Error 1 make[2]: Leaving directory '/c/Users/peile/.conan2/p/b/libic5861d38eefb11/b/build-release/srclib' make[1]: *** [Makefile:1500: all] Error 2 make[1]: Leaving directory '/c/Users/peile/.conan2/p/b/libic5861d38eefb11/b/build-release/srclib' make: *** [Makefile:34: all] Error 2 libiconv/1.17: ERROR: Package 'f8a46f395ffcd3089a1e8f725f80a502bf9374c6' build failed libiconv/1.17: WARN: Build folder C:\Users\peile\.conan2\p\b\libic5861d38eefb11\b\build-release ERROR: libiconv/1.17: Error in build() method, line 121 autotools.make() ConanException: Error 2 while executing
10-17
/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_atime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:69:10: note: in expansion of macro 'STAT_TIMESPE' 69 | return STAT_TIMESPEC (st, st_atim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_ctime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:82:10: note: in expansion of macro 'STAT_TIMESPE' 82 | return STAT_TIMESPEC (st, st_ctim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_mtime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/careadlinkat.c: In function 'careadlinkat': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:95:10: note: in expansion of macro 'STAT_TIMESPE' 95 | return STAT_TIMESPEC (st, st_mtim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/careadlinkat.c:178:5: warning: #warning "GCC might issue a bogus -Wreturn-local-addr warning here." [-Wcpp] 178 | #warning "GCC might issue a bogus -Wreturn-local-addr warning here." | ^~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_atime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/careadlinkat.c:179:5: warning: #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." [-Wcpp] 179 | #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." | ^~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:121:10: note: in expansion of macro 'STAT_TIMESPEC' 121 | return STAT_TIMESPEC (st, st_atim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/careadlinkat.c:182:10: warning: function may return address of local variable [-Wreturn-local-addr] 182 | return readlink_stk (fd, filename, buffer, buffer_size, alloc, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 183 | preadlinkat, stack_buf); | ~~~~~~~~~~~~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_ctime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/careadlinkat.c:181:8: note: declared here 181 | char stack_buf[STACK_BUF_SIZE]; | ^~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:135:10: note: in expansion of macro 'STAT_TIMESPEC' 135 | return STAT_TIMESPEC (st, st_ctim); | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -m64 -O3 -c -o stat-w32.o /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-w32.c /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_mtime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:149:10: note: in expansion of macro 'STAT_TIMESPEC' 149 | return STAT_TIMESPEC (st, st_mtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_birthtime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:167:7: note: in expansion of macro 'STAT_TIMESPE' 167 | t = STAT_TIMESPEC (st, st_birthtim); | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_dupfree.o `test -f 'malloc/scratch_buffer_dupfree.c' || echo '/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/'`malloc/scratch_buffer_dupfree.c In file included from /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c:54: /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_atime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:69:10: note: in expansion of macro 'STAT_TIMESPE' 69 | return STAT_TIMESPEC (st, st_atim).tv_nsec; | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_grow.o `test -f 'malloc/scratch_buffer_grow.c' || echo '/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/'`malloc/scratch_buffer_grow.c /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_ctime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:82:10: note: in expansion of macro 'STAT_TIMESPE' 82 | return STAT_TIMESPEC (st, st_ctim).tv_nsec; | ^~~~~~~~~~~~~ In file included from /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.c:21: /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_atime_ns': gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_grow_preserve.o `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/'`malloc/scratch_buffer_grow_preserve.c /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_mtime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:69:10: note: in expansion of macro 'STAT_TIMESPE' 69 | return STAT_TIMESPEC (st, st_atim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c: At top level: /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:95:10: note: in expansion of macro 'STAT_TIMESPE' 95 | return STAT_TIMESPEC (st, st_mtim).tv_nsec; | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o malloc/libicrt_a-scratch_buffer_set_array_size.o `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/'`malloc/scratch_buffer_set_array_size.c /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_ctime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c:68:1: error: conflicting types for 'rpl_fstat'; have 'int(int, struct _stati64 *)' 68 | rpl_fstat (int fd, struct stat *buf) | ^~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_atime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:82:10: note: in expansion of macro 'STAT_TIMESPE' 82 | return STAT_TIMESPEC (st, st_ctim).tv_nsec; | ^~~~~~~~~~~~~ In file included from /usr/include/time.h:158, from ./time.h:47, from /usr/include/sys/stat.h:9, from ./sys/stat.h:32, from /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c:25: ./sys/stat.h:955:1: note: previous declaration of 'rpl_fstat' with type 'int(int, struct _stati64 *)' 955 | _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); | ^~~~~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:121:10: note: in expansion of macro 'STAT_TIMESPEC' 121 | return STAT_TIMESPEC (st, st_atim); | ^~~~~~~~~~~~~ gcc -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib -I.. -I../lib -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -DNDEBUG -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -m64 -O3 -c -o uniwidth/libicrt_a-width.o `test -f 'uniwidth/width.c' || echo '/c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/'`uniwidth/width.c /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_mtime_ns': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c: In function 'rpl_fstat': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_ctime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:95:10: note: in expansion of macro 'STAT_TIMESPE' 95 | return STAT_TIMESPEC (st, st_mtim).tv_nsec; | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c:92:47: error: passing argument 2 of 'orig_fstat' from incompatible pointer type [-Wincompatible-pointer-types] 92 | return stat_time_normalize (orig_fstat (fd, buf), buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:135:10: note: in expansion of macro 'STAT_TIMESPEC' 135 | return STAT_TIMESPEC (st, st_ctim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_atime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c:35:34: note: expected 'struct stat *' but argument is of type 'struct _stati64 *' 35 | orig_fstat (int fd, struct stat *buf) | ~~~~~~~~~~~~~^~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_mtime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:121:10: note: in expansion of macro 'STAT_TIMESPEC' 121 | return STAT_TIMESPEC (st, st_atim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/fstat.c:92:53: error: passing argument 2 of 'stat_time_normalize' from incompatible pointer type [-Wincompatible-pointer-types] 92 | return stat_time_normalize (orig_fstat (fd, buf), buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:149:10: note: in expansion of macro 'STAT_TIMESPEC' 149 | return STAT_TIMESPEC (st, st_mtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_ctime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:211:58: note: expected 'struct _stati64 *' but argument is of type 'struct _stati64 *' 211 | stat_time_normalize (int result, _GL_UNUSED struct stat *st) /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_birthtime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:135:10: note: in expansion of macro 'STAT_TIMESPEC' 135 | return STAT_TIMESPEC (st, st_ctim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:167:7: note: in expansion of macro 'STAT_TIMESPE' 167 | t = STAT_TIMESPEC (st, st_birthtim); | ^~~~~~~~~~~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_mtime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:149:10: note: in expansion of macro 'STAT_TIMESPEC' 149 | return STAT_TIMESPEC (st, st_mtim); | ^~~~~~~~~~~~~ make[2]: *** [Makefile:1654: libicrt_a-fstat.o] Error 1 /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h: In function 'get_stat_birthtime': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:52:43: error: invalid use of undefined type 'const struct _stati64' 52 | # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) | ^~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:167:7: note: in expansion of macro 'STAT_TIMESPE' 167 | t = STAT_TIMESPEC (st, st_birthtim); | ^~~~~~~~~~~~~ make[2]: *** Waiting for unfinished jobs.... /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c: At top level: make[2]: *** [Makefile:1780: libicrt_a-stat-time.o] Error 1 /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c:112:1: error: conflicting types for 'rpl_stat'; have int(const char *, struct _stati64 *)' 112 | rpl_stat (char const *name, struct stat *buf) | ^~~~~~~~ In file included from /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c:51: ./sys/stat.h:1363:18: note: previous declaration of 'rpl_stat' with type 'int(const char * restrict, struct _stati64 * restrict)' 1363 | _GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf) | ^~~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c: In function 'rpl_stat': /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c:420:33: error: passing argument 2 of 'orig_stat' from incompatible pointer type [-Wincompatible-pointer-types] 420 | int result = orig_stat (name, buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c:37:47: note: expected 'struct stat *' but argument is of type 'struct _stati64 *' 37 | orig_stat (const char *filename, struct stat *buf) | ~~~~~~~~~~~~~^~~ /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat.c:436:45: error: passing argument 2 of 'stat_time_normalize' from incompatible pointer type [-Wincompatible-pointer-types] 436 | result = stat_time_normalize (result, buf); | ^~~ | | | struct _stati64 * /c/users/peile/.conan2/p/b/libic24a9b56de117d/b/src/srclib/stat-time.h:211:58: note: expected 'struct _stati64 *' but argument is of type 'struct _stati64 *' 211 | stat_time_normalize (int result, _GL_UNUSED struct stat *st) make[2]: *** [Makefile:1774: libicrt_a-stat.o] Error 1 make[2]: Leaving directory '/c/Users/peile/.conan2/p/b/libic24a9b56de117d/b/build-release/srclib' make[1]: *** [Makefile:1500: all] Error 2 make[1]: Leaving directory '/c/Users/peile/.conan2/p/b/libic24a9b56de117d/b/build-release/srclib' make: *** [Makefile:34: all] Error 2 libiconv/1.17: ERROR: Package 'f8a46f395ffcd3089a1e8f725f80a502bf9374c6' build failed libiconv/1.17: WARN: Build folder C:\Users\peile\.conan2\p\b\libic24a9b56de117d\b\build-release ERROR: libiconv/1.17: Error in build() method, line 121 autotools.make() ConanException: Error 2 while executing
最新发布
10-17
03-28
<think>好的,我现在需要处理用户关于Conan配置文件的问题。首先,用户提到了.conan相关的信息,可能是指Conan的配置文件、目录结构或者如何管理配置。根据用户提供的引用内容,引用[1]提到了Profiles和conan profile命令,引用[3]提到了环境变量和配置文件。因此,我需要将这些信息整合起来,给出清晰的回答。 首先,用户可能想知道Conan的配置文件在哪里,以及如何管理它们。根据引用[1],conan profile命令用于检查和管理配置文件,而引用[3]提到了环境变量的设置。需要解释默认的.conan目录结构,括profiles、settings.yml等文件的位置和作用。 接下来,用户可能对如何创建和修改profile文件感兴趣。引用[1]提到可以使用conan profile命令创建新的profile,或者手动编辑。需要给出具体步骤,比如使用命令conan profile new或者编辑现有文件。同时,引用[3]提到的环境变量如CONAN_LOG_LEVEL也需要说明,可能涉及如何配置日志级别。 另外,用户可能想知道如何共享配置文件。引用[1]提到可以使用conan config install来安装共享的配置,这部分需要详细说明步骤,比如从git仓库安装配置。 还需要检查是否有遗漏的信息,比如其他重要的配置文件或目录,比如conan.conf或者hooks文件夹。这些内容可能不在提供的引用中,但根据Conan的常识,应该含在回答中,确保用户获得全面的信息。 最后,生成的相关问题需要围绕用户可能的后续疑问,比如配置优先级、跨平台配置、环境变量使用等,确保问题覆盖用户可能的需求。</think>以下是与Conan配置文件及目录结构相关的信息整理: ### 一、Conan配置文件核心路径 Conan默认配置文件存储在用户主目录的`.conan`文件夹中,路径为: - Windows: `C:\Users\<用户名>\.conan` - Linux/macOS: `~/.conan` 目录结构示例: ``` .conan ├── profiles/ # 存放自定义构建配置模板 │ ├── default # 默认profile文件 │ └── linux_gcc12 # 自定义profile示例 ├── settings.yml # 定义全局编译选项[^3] ├── conan.conf # 核心配置文件[^3] └── hooks/ # 自定义构建钩子脚本 ``` ### 二、关键配置文件说明 1. **settings.yml** 定义全局编译参数,括: ```yaml os: [Windows, Linux, Macos] compiler: gcc: version: ["4.9", "5.4", "12.2"] build_type: [Release, Debug] ``` 2. **profiles文件** 通过`conan profile new myprofile`创建新配置模板,典型内容: ``` [settings] os=Linux compiler=gcc compiler.version=12 build_type=Release [options] zlib:shared=True ``` 3. **conan.conf** 配置缓存路径、下载超时等: ```ini [storage] path=~/.conan/data [proxies] http=http://proxy.example.com:8080 ``` ### 三、配置文件操作指南 1. **查看当前配置** ```bash conan profile show default ``` 2. **创建新profile**(两种方式) - 命令行创建: ```bash conan profile new myprofile --detect # 自动检测系统环境 ``` - 手动编辑: ```bash vim ~/.conan/profiles/custom_profile ``` 3. **共享配置文件** 通过`conan config install`安装远程配置: ```bash conan config install git@github.com:myteam/conan-config.git ``` ### 四、环境变量控制 | 变量名 | 功能描述 | |---------------------|----------------------------| | `CONAN_LOG_LEVEL` | 设置日志级别(10=DEBUG) | | `NO_COLOR` | 禁用彩色输出(值任意) | | `CONAN_TRACE_FILE` | 记录构建过程到指定文件 |
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值