【问题标题】:Executing cuda program through Eclipse is giving error通过 Eclipse 执行 cuda 程序出错
【发布时间】:2013-08-02 05:34:40
【问题描述】:

我正在使用 eclipse 来执行一个 cuda 程序。我已经下载了一个 CUDA PLUGIN 蚀。当我执行插件给出的示例 cuda 程序时它很好但是当我尝试时 执行任何其他程序我收到错误 undefined reference to main...

make 
Building target: Add_cuda
Invoking: NVCC Linker
nvcc -L/export/trainee3/dinesh/cuda5.0/lib64 -o  "Add_cuda"  ./mycuda.o   -lcudart
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

我在stackoverflow中发现有时我们会因为系统启动文件而遇到这个问题 我使用了标志 -nostartfiles 但在我的情况下它不起作用..

我在 c++ 构建中包含了 lib64 和包含路径。

所以任何解决这个问题的建议....

【问题讨论】:

标签: eclipse cuda linker


【解决方案1】:

我们一直是over this already

请改用nsight eclipse edition

如果您安装了 cuda 5.0 或 5.5,只需在终端会话中输入 nsight

如果你真的想使用那个 Eclipse CUDA 插件(我不相信它不再受支持),那么从你现在和当时都同意的 C++ 示例项目开始。然后修改该项目中的源代码。不要创建自己的项目。

【讨论】:

    【解决方案2】:

    安装 CUDA 5。它带有Nsight Eclipse 版本。使用起来非常优雅。 NV 视觉分析器与 Nsight 集成。语法高亮和调试模式非常容易使用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-27
      • 2018-03-18
      • 2021-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多