如何处理冲突类型,例如time_t,time64_t



我正在按照GitHub上的指南来构建应用程序。 指南从

sudo apt-get install mingw-w64 cmake
I was then asks to execute cmake foo foo -DBUILD32=OFF more foo
then to run make

事情进展顺利了一段时间。 找不到/usr/include 这样的错误:"bits"、"sys"、"gnu"、"asm" 解决了,因为这些文件夹在/usr/include/x86_64-linux-gnu 中 我刚刚将它们移动到 usr/include 中

但是,我不知道如何处理以下"冲突类型",正在寻求帮助

In file included from /usr/include/sys/types.h:130:0,
from /usr/include/stdlib.h:394,
from /home/jstateson/Projects/milkywayathome_client/milkyway/include/milkyway_util.h:28,
from /home/jstateson/Projects/milkywayathome_client/milkyway/src/milkyway_util.c:21:
/usr/include/bits/types/time_t.h:7:18: error: conflicting types for ‘time_t’
typedef __time_t time_t;
^~~~~~
In file included from /usr/share/mingw-w64/include/stddef.h:7:0,
from /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/include/stddef.h:1,
from /usr/include/stdio.h:33,
from /home/jstateson/Projects/milkywayathome_client/milkyway/include/milkyway_util.h:26,
from /home/jstateson/Projects/milkywayathome_client/milkyway/src/milkyway_util.c:21:
/usr/share/mingw-w64/include/crtdefs.h:138:20: note: previous declaration of ‘time_t’ was here
typedef __time64_t time_t;
^~~~~~

上面显示"time_t",但还有数百个,例如

typedef __ssize_t ssize_t;

__MINGW_EXTENSION typedef __int64 ssize_t;

发现问题:编译器包含行是-DOPENCL_INCLUDE_DIRS=/usr/include因为 OpenCL 库"CL"在"包含"中,并且源文件都有代码,例如#include "CL/cl.h"

这会导致冲突,因为该包含指令得到了整个"包含" 我通过创建文件夹"OpenCL"并将文件夹"CL"放入其中,然后编辑 cmake 以使其/usr/include/OpenCL

这一切都是由sudo apt-get install opencl-headers进入/usr/include/CL造成的

相关内容

最新更新