编译过程中,出现了好几次error: conflicting types for的问题,例如:
linux-arm-low.c:272:1: error: conflicting types for ‘ps_get_thread_area’
ps_get_thread_area (const struct ps_prochandle *ph,
^~~~~~~~~~~~~~~~~~
In file included from gdb_proc_service.h:30:0,
from linux-low.h:24,
from linux-arm-low.c:20:
/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/proc_service.h:72:17: note: previous declaration of ‘ps_get_thread_area’ was here
extern ps_err_e ps_get_thread_area (struct ps_prochandle *
这种问题比较好解决,重定义了嘛,直接把重定义的文件打开,把重定义的部分注释掉就可以了。
类似的报错:
proc-service.c:217:1: error: conflicting types for ‘ps_lsetfpregs’
proc-service.c:217:1: error: conflicting types for ‘ps_lsetfpregs’
arm-linux-nat.c:480:1: error: conflicting types for ‘ps_get_thread_area’
linux-arm-low.c:272:1: error: conflicting types for ‘ps_get_thread_area’
第二个问题:
gdb gdb_proc_service.h:173:9: error: unknown type name ‘gdb_fpregset_t’
在gdb/gdb_proc_service.h中,加入如下头文件:
include “gregset.h”
加之后的内容如下:
#ifndef GDB_PROC_SERVICE_H
#define GDB_PROC_SERVICE_H
#include <sys/types.h>
#include “gregset.h”
#ifdef HAVE_PROC_SERVICE_H