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' 之前的预期说明符限定符列表"?
基础教程推荐
- Windows Media Foundation 录制音频 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 从 std::cin 读取密码 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01