【问题标题】:Weird mistake while compilation编译时出现奇怪的错误
【发布时间】:2013-02-25 21:11:27
【问题描述】:

我的 cuSparse 程序运行正常,但修改后出现了一堆错误:

/tmp/tmpxft_000014cd_00000000-14_Sample2.0.o: In function `main':
tmpxft_000014cd_00000000-3_Sample2.0.cudafe1.cpp:(.text+0xb24): undefined reference to   `cusparseCreate'
tmpxft_000014cd_00000000-3_Sample2.0.cudafe1.cpp:(.text+0xb68): undefined reference to `cusparseCreateMatDescr'
tmpxft_000014cd_00000000-3_Sample2.0.cudafe1.cpp:(.text+0xbb4): undefined reference to `cusparseSetMatType'
tmpxft_000014cd_00000000-3_Sample2.0.cudafe1.cpp:(.text+0xbc8): undefined reference to `cusparseSetMatIndexBase'
tmpxft_000014cd_00000000-3_Sample2.0.cudafe1.cpp:(.text+0xc60): undefined reference to `cusparseScsrmv_v2'

这是什么意思? 程序中的 main() 函数变得非常混乱。这些错误可以与它有某种联系吗?可能我应该把程序分成几个部分吗?

【问题讨论】:

  • 什么修改?这意味着没有对 cuSparse 库的链接/访问。

标签: compiler-construction cuda sparse-matrix


【解决方案1】:

链接器说它缺少这些函数的定义。 你定义了这些函数吗?名字拼写正确吗?

//jk

【讨论】:

  • 糟糕!我很抱歉这个问题,我在编译时忘记添加 -lcusparse :(
猜你喜欢
  • 1970-01-01
  • 2013-04-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多