我将文件从tdk_3.304.5/nvml/include/nvml.h复制到了正确的包含路径,还将tdk_3.304.5/nvml/lib和lib64的库文件复制到了/usr/local/lib和/usr/local/lib64。但是在编译代码时,我遇到了一个错误,如下所示:/tmp/tmpxft_000030aa_00000000-14_gpupow.o: In function main': tmpxft_000030aa_00000000-3_gpupow.cudafe1.cpp:(.text+0xc): undefined reference to nvmlInit'等等。你能告诉我问题出在哪里吗? - Vaibhav Sundriyal
是的,你在编译命令中没有链接 nvml 库。请查看 TDK 中示例项目中的 makefile,了解如何调用和链接库。 - Robert Crovella
main': tmpxft_000030aa_00000000-3_gpupow.cudafe1.cpp:(.text+0xc): undefined reference to
nvmlInit'等等。你能告诉我问题出在哪里吗? - Vaibhav Sundriyal