cuda5.0编程错误求助!

在cuda5.0编程过程中出现这个错误,跪求解决。
1>ptxas C:/Users/ADMINI~1/AppData/Local/Temp/tmpxft_00001a64_00000000-7_kernel.compute_20.ptx, line 2289; : fatal error : Parsing error near ‘-’: syntax error
1>ptxas : fatal error : Ptx assembly aborted due to errors

哪位大大知道如何解决啊,感激不尽!

楼主您好!这个是已知BUG. 从3.x到5.0都存在的。

解决方案:
(1)等待下个版本的toolkit(例如cuda 6.0), 安装并观察问题是否消失。
(2)无需等待,修改您的项目的位置,不要使用中文路径。

感谢您的莅临。

您的第二个方法我试过了,但当调试的时候又出现这样的错误

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutSwapBuffers@0,该符号

在函数 “void __cdecl display(void)” (?display@@YAXXZ) 中被引用

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutDisplayFunc@4,该符号

在函数 “bool __cdecl initGL(int *,char * *)” (?initGL@@YA_NPAHPAPAD@Z) 中被引用

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutCreateWindow@4,该符

号在函数 “bool __cdecl initGL(int *,char * *)” (?initGL@@YA_NPAHPAPAD@Z) 中被引用

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutInitWindowSize@8,该符

号在函数 “bool __cdecl initGL(int *,char * *)” (?initGL@@YA_NPAHPAPAD@Z) 中被引用

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutInitDisplayMode@4,该符

号在函数 “bool __cdecl initGL(int *,char * *)” (?initGL@@YA_NPAHPAPAD@Z) 中被引用

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutInit@8,该符号在函

数 “bool __cdecl initGL(int *,char * *)” (?initGL@@YA_NPAHPAPAD@Z) 中被引用

1>kernel.cu.obj : error LNK2019: 无法解析的外部符号 __imp__glutMainLoop@0,该符号在

函数 “bool __cdecl runTest(int,char * *,char *)” (?runTest@@YA_NHPAPADPAD@Z) 中被引用

1>E:\cuda_gl_mfc\cuda5.0_gl\Debug\cuda5.exe : fatal error LNK1120: 7 个无法解析的外部命


这该如何解决啊?以前遇到这样的问题,只要把库的顺序调换一下就好了,但这个我调换了却不行。

楼主您好,恭喜您第1个问题成功解决。

关于您的第二个问题,“在调试时候出错”,我表示:
(1)您的这个问题是链接错误,是linker在linking时刻的错误提示,而不是在调试时。
(2)既然是链接错误,您需要链接相应的库,根据您的问题,您需要freeglut.lib。

freeglut由非本论坛的第三方势力进行维护,但您可以免费使用它。
一般情况下,每个人的硬盘上都有freeglut.lib,您可以尝试去寻找它,或者您可以直接重新下一份。
如果需要搜索,我建议您找寻c:\programdata\。
如果需要下载,我建议您打开:http://freeglut.sourceforge.net

此外,需要提醒您的是,抄袭有风险,写作需谨慎。

感谢您的答复,我会小心求证的!