What does this error mean: quot;error: expected specifier-qualifier-list before #39;type_name#39;quot;?(此错误是什么意思:“错误:type_name 之前的预期说明符限定符列表?)
问题描述
我一直在研究 Cell 处理器,我正在尝试创建一个包含 spe_context_ptr_t
的结构体,该结构体将在线程中用于启动 spe 上下文,并且还将保存指向将从线程内传递给 spu 上下文的其他内容的指针(目前我正试图使其成为通用指针,但实际上它将是指向我定义的另一个结构的指针).当我尝试编译时,出现以下错误:
I've been working on the Cell processor and I'm trying to create a struct that will hold an spe_context_ptr_t
, which will be used within the thread to launch an spe context and will also hold a pointer to something else that will be passed to the spu context from within the thread (currently I'm trying to just make it a generic pointer, but in actuality it will be a pointer to another structure I've defined). When I try and compile, I get the following error:
spu/../common.h:38: error: expected specifier-qualifier-list before 'spe_context_ptr_t'
// here is the offending line(s)
typedef struct _PTHREAD_BLOCK {
spe_context_ptr_t * context; // Error happens here
uintptr32_t args;
} PTHREAD_BLOCK;
推荐答案
编译器不知道 spe_context_ptr_t 是一个类型.编译此代码时,请检查适当的 typedef 是否在范围内.您可能忘记包含适当的头文件.
The compiler doesn't know that spe_context_ptr_t is a type. Check that the appropriate typedef is in scope when this code is compiled. You may have forgotten to include the appropriate header file.
这篇关于此错误是什么意思:“错误:'type_name' 之前的预期说明符限定符列表"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:此错误是什么意思:“错误:'type_name' 之前的预期说明符限定符列表"?


- 如何对自定义类的向量使用std::find()? 2022-11-07
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- C++ 协变模板 2021-01-01
- 近似搜索的工作原理 2021-01-01
- STL 中有 dereference_iterator 吗? 2022-01-01
- 从python回调到c++的选项 2022-11-16
- Stroustrup 的 Simple_window.h 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01