C error: Expected expression
Mark Brethen
mark.brethen at gmail.com
Tue Nov 13 17:52:11 UTC 2018
APIENTRY is defined in GL3.h. Snippet below,
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#if defined(__APPLE__)
#define GL3_PROTOTYPES
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/* Base GL types */
#include <OpenGL/gltypes.h>
#ifdef __cplusplus
extern "C" {
#endif
But the source only had these includes:
#include <GL/gl.h>
#include <GL/glu.h>
which I patched with OpenGL.
From GL3.h:
* gl3.h is supposed to only include APIs in a OpenGL 3.1 (without
* GL_ARB_compatibility) or OpenGL 3.2 or later core profile
* implementation, as well as interfaces for newer ARB extensions which
* can be supported by the core profile. It does not, and never will
* include functionality removed from the core profile, such as
* fixed-function vertex and fragment processing.
*
* Implementations of OpenGL 3.1 supporting the optional
* GL_ARB_compatibility extension continue to provide that functionality,
* as do implementations of the OpenGL 3.2+ compatibility profiles, and
* source code requiring it should use the traditional <GL/gl.h> and
* <GL/glext.h> headers instead of <GL3/gl3.h>.
*
* It is not possible to #include both <GL3/gl3.h> and either of
* <GL/gl.h> or <GL/glext.h> in the same source file.
Do I need to patch the source and replace the GL includes with GL3?
Mark Brethen
mark.brethen at gmail.com
> On Nov 13, 2018, at 8:57 AM, Chris Jones <jonesc at hep.phy.cam.ac.uk> wrote:
>
>
>> Perhaps a semicolon is needed? i.e.
>> int APIENTRY;
>> glutExtensionSupported(const char *extension)
>
> nope, that is definitely invalid code.
>
> As Joshua said, you need to investigate how APIENTRY is defined.
>
> Chris
>
More information about the macports-dev
mailing list