令牌之前的预期初始值设定项'*'
expected initializer before '*' token
本文关键字:令牌 更新时间:2023-10-16
我正在尝试创建一个控制台应用程序,该应用程序在我正在使用的网络书籍的帮助下利用套接字和 ncurses。在编译时,我收到错误"该行的"*"标记之前的预期初始值设定项:
WINDOW* create_newwin(int height, int width, int starty, int startx);
在我包含一些我忘记包含的新标头(主要是网络标头(之前,我没有收到此错误。错误前的标题
#include <ncurses.h>
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <string.h>
错误开始抛出时我添加的标头
#include <stdio.h> //for printf() and fprintf()
#include <sys/socket.h> //for socket(), connect(), send(), and recv()
#include <arpa/inet.h> //for sockaddr_in and inet_addr()
#include <unistd.h> //for close()
#include <iostream>
#include "DakchatHeader.hpp"
我知道这是标题,因为当我将它们注释掉时,特定的错误就会消失(但会出现有关未知函数等的错误(。
还应该注意的是,当我调用它时,它说的是未知函数,并且 WINDOW 是在 ncurses 中定义的。
谢谢你能给我的所有帮助!
在我的DakchatHeader.hpp文件中,我忘记在创建结构后添加一个semicolin。修复后,错误不再显示。
相关文章:
- 如何在C++中使用X509证书模在令牌中查找私钥
- holeMenuProgram.cpp:38:1 错误:'}'令牌之前的预期主表达式
- C++:"("令牌"之前有预期的非限定 id 指向类中成员函数的指针
- Arduino 用于语句错误。令牌之前的预期')' ';'。如何解决这个问题?
- 错误:令牌 { '{' 之前应存在非限定 ID
- 允许哪些令牌作为 #include 的参数?
- "错误 C0000:语法错误,令牌"<EOF>"处出现意外$end,并且不确定
- 它在 { 令牌之前给了我预期的标识符
- (错误:令牌之前'<<'预期的主表达式)
- 为什么 ## aka 令牌粘贴运算符不适用于 C 和 C++ 中的注释?
- 错误:"->"令牌之前的预期初始值设定项
- LINUX 操作系统上的错误:令牌之前预期的构造函数、析构函数或类型转换'('?
- 丢失读入的每一行输入中的最后一个令牌
- 如何使用 libCurl 将访问令牌发送到服务器 API
- C++令牌定义成员
- 宏定义中的预处理器令牌两边有两个双引号
- 错误:C++中']'令牌之前的预期主表达式
- 错误:令牌之前的预期主表达式'&&'
- 令牌之前']'预期的主表达式?
- 根据特定条件从文件中检索每个令牌