致命错误C1012:不匹配的括号:缺少')' [英] Fatal error C1012: unmatched parenthesis : missing ')'
本文介绍了致命错误C1012:不匹配的括号:缺少')'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有编译错误
fatal error C1012: unmatched parenthesis : missing ')'
在行中:
In line:
#if !defined(FALSE) || (FALSE !=0)
和
and
#if !defined(TRUE) || (TRUE!=1)
使用VC ++ 2012编译文件时开头:
while using VC++2012 to compile the file beginning with:
#ifndef __INCvxWorksh
#define __INCvxWorksh
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(NULL)
#if defined __GNUG__
#define NULL (__null)
#else
#if !defined(__cplusplus) && 0
#define NULL ((void*)0)
#else
#define NULL (0)
#endif
#endif
#endif
#if !defined(EOF) || (EOF!=(-1))
#define EOF (-1)
#endif
#if !defined(FALSE) || (FALSE !=0)
#define FALSE 0
#endif
#if !defined(TRUE) || (TRUE!=1)
#define TRUE 1
#end
.......
为什么?两者具有相同的#if结构,但编译在它们之前传递。
原始代码来自VxWorks / Tornado上的应用程序。
我尝试了什么:
我使用致命错误C1012:不匹配的括号:丢失)来搜索它但是不能找到满意的答案或解释。
How come? The two have the same #if structure, but compilation passed before them.
The original codes come from application on VxWorks/Tornado.
What I have tried:
I googled it in using " fatal error C1012: unmatched parenthesis : missing ')'" but can't find satisfied answers or explanation.
推荐答案
好像你错过了代码中的#endif
Seems like you are missing an #endif in your code
#if !defined(FALSE) || (FALSE !=0)
#if !defined(FALSE)
#define FALSE 0
#endif
#endif // Added one #endif
这也可能是一个问题,除非它是副本和粘贴中的错过
also this might be a problem unless it was a miss in the copy&paste
#if !defined(TRUE) || (TRUE!=1)
#define TRUE 1
#endif // Changed from #end to #endif
这篇关于致命错误C1012:不匹配的括号:缺少')'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文