加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

编译工具error: `xxx' undeclared (first use in this function)解决方法

(2017-07-21 14:44:56)

安装gdbserver

 

  1. cd /work/debug/gdb-7.4/gdb/gdbserver/  
  2.  ./configure --host=arm-linux;(表示编译出来的gdbserver要运行在linux下) 
  3.  make;此时会出现问题:
linux-arm-low.c: In function `arm_stopped_by_watchpoint':
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

 linux-arm-low.c:642: error: for each function it appears in.)

解决方法:

  1. echo $PATH;查看包含的路径,编译时会在这些路径里寻找头文件。此处有一 项:/work/tools/gcc-3.4.5-glibc-2.3.6/bin
  2. cd /work/tools/gcc-3.4.5-glibc-2.3.6/;   grep "PTRACE_GETSIGINFO" * -nR;发现arm-linux/include/linux/ptrace.h:27: #define PTRACE_GETSIGINFO  0x4202
  3. cd/work/debug/gdb-7.4/gdb/gdbserver;     
  4. vi linux-arm-low.c;将#include 后边添加#include
  5. make;  编译成功
 4. cp gdbserver /work/nfs_root/first_fs/bin

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有