c++ - error c2007: #define syntax // 注释块中的语法无效?
问题描述
我目前的问题是我的程序即使在 30 分钟前编译也不会编译。
我将一切恢复正常,我的编译器显示错误消息ui.h(62): error C2007: #define syntax
。但是在第 62 行根本没有代码,因为有一个注释块。
我试图重建并清除解决方案,但没有任何效果。我使用三种类型的定义。
#define DEFAULT_PATH "C:\\"
#define IMG_Y 35
#define TXT_COLOR 0x323232
编辑:添加代码
#define IMG_WIDTH 448
#define IMG_HEIGHT 342
#define IMG_X 96
#define IMG_Y 35
#define DEFAULT_PATH "C:\\"
/*
* Requests a path to save the image at from the user
*/
void function(std::string& file_path)
{
std::cout<<"Test"<<std::endl;
}
解决方案
此错误意味着您后面有一个#define
没有标识符的。
在您的代码中搜索悬空的#define
.
之后也可以发表评论#define
:
#define //DEFAULT_PATH
推荐阅读
- php - 在 Woocommerce 商店页面上显示每个产品的发布日期
- c++ - 如何从向量C++中的字符串指向第n个字符
- python - 数据框大小的限制
- regex - 正则表达式匹配 X 位数字或字母,但不匹配 X 行中的字母
- python - 询问马尔可夫模拟的结果 - 高度赞赏的帮助和反馈
- javascript - 进行加载过程时,Mouseover 和 Mouseout 不起作用
- android - 作为 Open Beta 发布的 Android 应用的可见性是否与公开发布相同?
- php - Laravel 为路由提供数组,并非所有值都是必需的
- html - 如何编写脚本来输出 html 文件?
- r - 两个 sf 对象的联合