2013-03-10 56 views
0

我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()變得相當混亂。這些錯誤能否以某種方式與它聯繫在一起?可能我應該將程序分成幾個部分?

+2

什麼修改?這意味着沒有鏈接/訪問cuSparse庫。 – 2013-03-10 18:37:18

回答

0

鏈接器說它缺少這些函數的定義。 你定義了這些函數嗎?名稱拼寫是否正確?

// jk

+0

糟糕!我很抱歉,我忘了在編譯時加上-lcusparse: – Max 2013-03-10 19:03:26