【问题标题】:eclipse debug not workeclipse调试不起作用
【发布时间】:2017-03-24 02:41:33
【问题描述】:

我用eclipse运行c语言程序

构建项目后,打印

构建目标:testusb 调用:Cross GCC Linker gcc -L/opt/local/lib -lusb-1.0 -o "testusb" ./src/testusb.o 编译完成目标:testusb

14:44:40 构建完成(耗时 120 毫秒)

14:44:49 **** 项目配置调试的增量构建 testusb **** make all make: `all' 无事可做。

14:44:49 构建完成(耗时 68 毫秒)

14:45:10 **** 项目配置调试的增量构建 testusb **** make all make: `all' 无事可做。

14:45:10 构建完成(耗时 65 毫秒)

在终端中,当我 cd 目录并输入 testusb 时,它会打印成功。

但是当我调试使用 eclipse 时,它​​不会打印成功并且无法进入主断点。

调试配置是

项目结构是 该程序是

#include <stdio.h>
#include <stdlib.h>
#include <libusb-1.0/libusb.h>
int main(void) {
    libusb_context **libcontext;
    libusb_device ***deviceList;
    int status = libusb_init(libcontext);
    if (status == 0) {
//      libusb_get_device_list(*libcontext,deviceList);
        printf("success");
    }

}

我的问题是为什么调试不能进入断点,也不能打印成功?

【问题讨论】:

  • 你用的是哪个版本的eclipse?
  • 面向 C/C++ 开发人员的 Eclipse IDE 版本:Mars.2 Release (4.5.2)

标签: c eclipse


【解决方案1】:

我发现原因是eclipse默认支持gdb,但是mac是ggdb。我尝试解决方案Eclipse CDT cannot debug using gdb on Mac 但是比 El Capitan 更新的 OS X 版本不支持 apple-gcc42,我的 mac 是 macos sierra

我更改 xcode

我添加

它可以调试!

参考Linking Libraries in Xcode

ld: library not found for -lGoogleAnalytics

【讨论】:

    猜你喜欢
    • 2011-06-04
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-09
    • 1970-01-01
    • 2010-12-03
    相关资源
    最近更新 更多