Click here to Skip to main content
15,888,085 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've got compilation error of "
fatal error C1012: unmatched parenthesis : missing ')'


In line:
C++
#if	!defined(FALSE) || (FALSE !=0)

and
C++
#if	!defined(TRUE) || (TRUE!=1)


while using VC++2012 to compile the file beginning with:

C++
#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
.......



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.
Posted
Updated 22-May-16 22:25pm
v6

1 solution

Seems like you are missing an #endif in your code

C++
#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
C++
#if	!defined(TRUE) || (TRUE!=1)
#define TRUE		1
#endif   // Changed from #end to #endif
 
Share this answer
 
v2
Comments
Stan Huang 23-May-16 4:26am    
Sorry, I made a mistake in adding one more line of "#define FALSE 0". I removed it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900