cutil函数编译程序

发布于 2024-10-06 03:02:18 字数 851 浏览 0 评论 0原文

我正在使用 cutil.h 中的一些函数来计时我的代码。它在 Windows XP 和 vs 2008 上编译得很好。最近,我切换到 Windows 7 和 vs 2008。相同的代码无法编译,并且出现以下错误,

1>链接:C:\Users\weiqi\Documents\Visual Studio 2008\Projects\corrColumnLateral\Debug\corrColumnLateral.exe 未找到 或者不是由最后一个增量链接构建的;表演完整 link1>corrColumnLateral.cu.obj:错误 LNK2019:无法解析的外部 函数中引用的符号 _imp_cutStopTimer@4 _main1>corrColumnLateral.cu.obj:错误 LNK2019:函数中引用的无法解析的外部符号 _imp_cutStartTimer@4 _main1>corrColumnLateral.cu.obj:错误 LNK2019:函数中引用的无法解析的外部符号 _imp_cutResetTimer@4 _main1>corrColumnLateral.cu.obj:错误 LNK2019:函数中引用的无法解析的外部符号 _imp_cutGetTimerValue@4 _main1>corrColumnLateral.cu.obj:错误 LNK2019:函数 _main 中引用的无法解析的外部符号 _imp_cutCreateTimer@4

头文件​​中的宏(例如 CUDA_SAFE_CALL)工作正常,但像 cutCreatTimer 这样的计时函数失败来编译。有谁知道发生了什么事?

I am using some of the functions from cutil.h to time my code. It compiles fine on windows xp with vs 2008. Recently, I switch to window 7 and vs 2008. The same code doesn't compile and I have following error,

1>LINK : C:\Users\weiqi\Documents\Visual Studio
2008\Projects\corrColumnLateral\Debug\corrColumnLateral.exe not found
or not built by the last incremental link; performing full
link1>corrColumnLateral.cu.obj : error LNK2019: unresolved external
symbol _imp_cutStopTimer@4 referenced in function
_main1>corrColumnLateral.cu.obj : error LNK2019: unresolved external symbol _imp_cutStartTimer@4 referenced in function
_main1>corrColumnLateral.cu.obj : error LNK2019: unresolved external symbol _imp_cutResetTimer@4 referenced in function
_main1>corrColumnLateral.cu.obj : error LNK2019: unresolved external symbol _imp_cutGetTimerValue@4 referenced in function
_main1>corrColumnLateral.cu.obj : error LNK2019: unresolved external symbol _imp_cutCreateTimer@4 referenced in function _main

The macros from the header file, such as CUDA_SAFE_CALL, work fine, but timing functions like cutCreatTimer fail to compile. Does anyone knows what is going on?

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

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

发布评论

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

评论(2

月朦胧 2024-10-13 03:02:18

如果右键单击 cu 源文件并选择属性:

然后转到 CUDA C/C++ 并在 Common 下将 cutil.h 的位置添加到附加包含目录文件夹中。

对我来说这是:C:\ProgramData\NVIDIA Corporation\NVIDIA GPUComputing SDK 3.2\C\common\inc

IF you right click your cu source file and select properties:

Then go to CUDA C/C++ and under Common add the location of the cutil.h to the Additional Include Directories folder.

For me this was: C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\common\inc

幸福还没到 2024-10-13 03:02:18

您需要链接到 cutil 库。在 Linux 上,它称为 libcutil.so 或 libcutil.a。 Windows 版本的名称中可能也包含“cutil”,因此您可以搜索该文件并将其添加到链接器选项中。

You need to link to the cutil library. On linux it's called libcutil.so or libcutil.a. The windows version probably also has "cutil" in its name, so you can search for that file and add it to your linker options.

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