GstGlApi compile error
Gordon Nickel
gordon.nickel at downstream.com
Wed Sep 30 13:45:01 PDT 2015
Thanks for the tip Matt. I compiled with the preprocessor output, and didn't notice anything glaring in the output file (the macros in question looks like they were parsed correctly).
To eliminate any project-specific setup issues, I started a brand new Win32 project in VS2013 and VS2010, included <gst/gl/gl.h> (along with relevant incude paths), and it produced identical syntax errors. If I mouse over the GST_GL_EXT_FUNCTION (which has the red syntax-error squiggles underneath it), VS shows: "Error: a calling convention may not be followed by a nested declarator. " Investigating that further, I changed the following in gstglapi.h:
#define GST_GL_EXT_FUNCTION(ret, name, args) \
ret GSTGLAPI (*name) args;
To:
#define GST_GL_EXT_FUNCTION(ret, name, args) \
ret GSTGLAPI name args;
Which was able to build and run using gl elements in gstreamer (glupload, glfilterblur, glimagesink). GSTGLAPI eventually points to _stdcall, so I'm guessing Visual Studio's compiler doesn't like the pointer syntax for __stdcall?
- Gordon
From: Matthew Waters [mailto:ystreet00 at gmail.com]
Sent: Wednesday, September 30, 2015 3:09 AM
To: Gordon Nickel <gordon.nickel at downstream.com>; gstreamer-devel at lists.freedesktop.org
Subject: Re: GstGlApi compile error
On 30/09/15 10:38, Gordon Nickel wrote:
Hi,
I'm attempting to use the gl api for playback in a C++ app, and getting a wall of compile errors when I include gst/gl/gl.h using 1.6.0 in Windows with VS2013. The error is:
1>c:\gstreamer\1.0\x86\include\gstreamer-1.0\gst\gl\glprototypes\base.h(51): error C2059: syntax error : '('
1>c:\gstreamer\1.0\x86\include\gstreamer-1.0\gst\gl\glprototypes\base.h(51): error C2238: unexpected token(s) preceding ';'
Which points to this line (and every other line using GST_GL_EXT_FUNCTION):
GST_GL_EXT_FUNCTION (void, BindTexture,
(GLenum target, GLuint texture))
I've double-checked all the include paths - is there something I'm missing?
Nothing comes to mind off the top of my head. A simple c++ application that just performs #include <gst/gl/gl.h> works with both g++ and gcc fine so I'm not sure what the problem could be without seeing code/more errors. Of course the real error could be somewhere else that's confusing the preprocessor into generating bad code. You could try examining the preprocessor's output see https://msdn.microsoft.com/en-us/library/8z9z0bx6.aspx.
Cheers
-Matt
Thanks!
Gordon Nickel
Lead Developer
downstream
1624 NW Johnson Street
Portland, OR 97209, USA
503.226.1944 main
503.226.1283 fax
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150930/28ee152c/attachment.html>
More information about the gstreamer-devel
mailing list