通过Eclipse执行cuda程序是给错误 [英] Executing cuda program through Eclipse is giving error

查看:195
本文介绍了通过Eclipse执行cuda程序是给错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用eclipse来执行cuda程序。我已经下载了一个CUDA PLUGIN
eclipse。当我执行示例cuda程序给出的插件它的罚款,但当我尝试
执行任何其他程序,我得到错误未定义的引用主...

I am using eclipse to execute a cuda program. I have downloaded a CUDA PLUGIN for eclipse. When I execute sample cuda program given by plugin its fine but when I try to execute any other program I am getting error 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但它不工作在我的情况下。

I found in stackoverflow that some times we get this problem because of system startup file I used flag -nostartfiles but it is not working in my case..

我在c ++ build中包含了lib64和include路径。

I have included lib64 and include path in c++ build.

因此任何建议都可以解决这个问题....

So any suggestion to over come this problem....

推荐答案

p>我们已经完成此操作

使用 nsight eclipse版本

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

If you have cuda 5.0 or 5.5 installed, just type nsight in a terminal session.

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

If you really want to use that Eclipse CUDA plugin (which is no longer supported, I don't believe), then start with the C++ sample project, which you agree now and back then would work. Then modify the source code in that project. Don't create your own project.

这篇关于通过Eclipse执行cuda程序是给错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆