编译工具error: `xxx' undeclared (first use in this function)解决方法
(2017-07-21 14:44:56)安装gdbserver
- cd
/work/debug/gdb-7.4/gdb/gdbserver/
-
./configure --host=arm-linux;(表示编译出来的gdbserver要运行在linux下) -
make;此时会出现问题:
linux-arm-low.c:642: error: `PTRACE_GETSIGINFO' undeclared (first use in this function)
linux-arm-low.c:642: error: (Each undeclared identifier is reported only once
解决方法:
- echo $PATH;查看包含的路径,编译时会在这些路径里寻找头文件。此处有一 项:/work/tools/gcc-3.4.5-glibc-2.3.6/bin
- cd
/work/tools/gcc-3.4.5-glibc-2.3.6/; PTRACE_GETSIGINFO" * -nR;发现arm-linux/include/linux/ptrace.h:27: #define PTRACE_GETSIGINFOgrep " 0x4202 - cd/work/debug/gdb-7.4/gdb/gdbserver;
- vi linux-arm-low.c;将#include 后边添加#include
- make;
编译成功
后一篇:stmdb和ldmia