35.如何使用conan包

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(
使用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、付费专栏及课程。

余额充值