将 Cuda CU 文件与许多其他文件分离以及 OPENGL 编译问题

发布于 2024-12-14 19:44:30 字数 1389 浏览 0 评论 0原文

我有一个巨大的 CU 文件,其中包含我的项目,我试图将其分成小 CU 文件,但我收到许多 gl.h 错误,我不知道该怎么办......这让我发疯......

1>  Compiling CUDA source file core.cu...
1>  
1>  C:\Users\igal\Desktop\prj trying to devide files\graph>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include"  -G0  --keep-dir "Debug" -maxrregcount=0  --machine 32 --compile  -D_NEXUS_DEBUG -g    -Xcompiler "/EHsc /nologo /Od /Zi  /MDd " -o "Debug\core.cu.obj" "C:\Users\igal\Desktop\prj trying to devide files\graph\core.cu" 
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error : this declaration has no storage class or type specifier
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error : expected a ";"
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error : this declaration has no storage class or type specifier
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error : variable "WINGDIAPI" has already been defined
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error : expected a ";"

并且这个列表还在继续..

i have a huge CU file which contains my project , im trying to separate it into small CU files , but im getting many gl.h errors , i dont know what to do... it's driving me crazy..

1>  Compiling CUDA source file core.cu...
1>  
1>  C:\Users\igal\Desktop\prj trying to devide files\graph>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include"  -G0  --keep-dir "Debug" -maxrregcount=0  --machine 32 --compile  -D_NEXUS_DEBUG -g    -Xcompiler "/EHsc /nologo /Od /Zi  /MDd " -o "Debug\core.cu.obj" "C:\Users\igal\Desktop\prj trying to devide files\graph\core.cu" 
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error : this declaration has no storage class or type specifier
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error : expected a ";"
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error : this declaration has no storage class or type specifier
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error : variable "WINGDIAPI" has already been defined
1>c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error : expected a ";"

and the list goes on..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染墨丶若流云 2024-12-21 19:44:30

由于您使用的是 Windows,请确保在包含 gl.h 或任何其他可能间接包含 gl.h< 的文件之前包含 windows.h /代码>。

正如 MSDN 中所述,这是OpenGL 工作所必需的。

Since you're on Windows, make sure that you include windows.h before including gl.h, or any other file which may indirectly include gl.h.

As stated on MSDN, this is necessary for OpenGL to work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文