Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my code:

C++
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
#error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
#endif
#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_3_0
#error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_0"
#endif

#define GDK_AVAILABLE_IN_ALL                  _GDK_EXTERN

/* XXX: Every new stable minor release should add a set of macros here */

#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_0
# define GDK_DEPRECATED_IN_3_0                GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_0_FOR(f)         GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_0                _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_0_FOR(f)         _GDK_EXTERN
#endif

#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_0
# define GDK_AVAILABLE_IN_3_0                 GDK_UNAVAILABLE(3, 0)
#else
# define GDK_AVAILABLE_IN_3_0                 _GDK_EXTERN
#endif


Now, note, I do not take credit for this code; it was downloaded from [^]

But, I needed this header for one of my source codes; therefore, I copied it. The error occurs within the line #if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_0 and of its similar kinds. Can anyone tell me why this is happening?

What I have tried:

Really, I have tried very little, for I have no idea where even to begin!!! I did not put any brackets in "#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_0" but it is still showing me the error missing binary operator before token "(". Please help!
Posted
Updated 17-Dec-17 6:33am
v2
Comments
PIEBALDconsult 17-Dec-17 12:03pm    
Oh, what grotty code.
Look at the definitions of the macros.
Examine the output of the pre-processor.

Quote:
I have no idea where even to begin!
Go back to the place where you downloaded this code and ask there. It is a complete waste of time downloading code from the internet if you do not understand what it is or what it does.
 
Share this answer
 
Comments
Member 13581003 18-Dec-17 22:38pm    
thank you all so much! When I first posted this, I did not expect any replies. So thank you!
It's something else in your code: If I copy and paste that lot into a C compiler (or C++) it compiles without problems.
So start by looking at what else you have in there, particularly inside #include files and look for other substitutions. Remember, #DEFINE is a preprocessor operation that effectively does text substitution without any real intelligence. So if you have some other substitutions going on...
 
Share this answer
 
It seems that you need to find out what the definitions of these are :

GDK_VERSION_MAX_ALLOWED
GDK_VERSION_MIN_REQUIRED

I don't know what compiler you have but with VS17 you can right click on the macro and select go to definition and find out what the values of these and where they are defined. Also, just hovering the mouse over them should show their values.
 
Share this answer
 

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