c++ - '*' 标记之前的预期初始化程序
问题描述
我正在尝试创建一个控制台应用程序,该应用程序在我正在使用的网络书籍的帮助下利用套接字和 ncurses。在编译时,我收到错误 'expected initializer before '*' token for the line:
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 文件中,我在创建结构后忘记添加分号。修复后不再显示错误。
推荐阅读
- jsf - 在 Primefaces Extensions documentViewer 中加载内容
- mongodb - 将数据从 Access 导出到 CSV 文件以在 MongoDB 中使用
- ios - 如何显示像放大镜一样大的文本
- excel - 运行时错误 1004:Microsoft Excel 无法访问该文件
- r - 针对连续自变量绘制二元因变量以进行探索性分析
- python - 将一个 numpy 数组与另一个数组的每个元素进行比较
- android - React-native fontawesome 一些图标没有显示
- r - 内半径极地 Highcharter
- python - 用 Python 的数学保持准确的值?
- android - 如何使用 volley 读取 JSON 对象