Visual studio 2010 CUDA:不允许使用不完整类型等。
代码:Visual studio 2010 CUDA:不允许使用不完整类型等。,visual-studio-2010,visual-c++,cuda,Visual Studio 2010,Visual C++,Cuda,代码: 我不明白是什么问题。因为我看不出这条线有什么奇怪的地方。我使用CUDA 4.2,正如前面指出的,您有一些语法错误 uchar未在程序中的任何位置定义。或者添加一个 它的定义或将其更改为无符号字符,这是正确的 C/C++类型 此处的花括号排列不正确: src/fluid_system.cu(30): error : incomplete type is not allowed (points to line -> "void Grid_InsertParticleCUDA") src
我不明白是什么问题。因为我看不出这条线有什么奇怪的地方。我使用CUDA 4.2,正如前面指出的,您有一些语法错误
uchar
未在程序中的任何位置定义。或者添加一个
它的定义或将其更改为无符号字符
,这是正确的
C/C++类型src/fluid_system.cu(30): error : incomplete type is not allowed (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(30): error : identifier "uchar" is undefined (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(30): error : identifier "data" is undefined (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(30): error : expected a ")" (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(31): error : expected a ";" (points to line after line-> "void Grid_InsertParticleCUDA")
未定义
uchar
和uint
。你是说无符号字符
和无符号整数
?也许我错了,但是外部“C”
之后的括号{
似乎没有关闭?
src/fluid_system.cu(30): error : incomplete type is not allowed (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(30): error : identifier "uchar" is undefined (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(30): error : identifier "data" is undefined (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(30): error : expected a ")" (points to line -> "void Grid_InsertParticleCUDA")
src/fluid_system.cu(31): error : expected a ";" (points to line after line-> "void Grid_InsertParticleCUDA")
extern "C"
{ // this opening curly-brace has no proper corresponding close-brace
// Compute number of blocks to create
int iDivUp (int a, int b) { // this open brace
return (a % b != 0) ? (a / b + 1) : (a / b);
} // ... closes here
// you should insert another closing curly-brace here }
void computeNumBlocks ...