Compilation with winegcc vs compilation in Wine source

Ruslan Kabatsayev b7.10110111 at gmail.com
Tue Aug 16 23:46:08 CDT 2016


On Wed, Aug 17, 2016 at 6:27 AM, Ken Thomases <ken at codeweavers.com> wrote:
> On Aug 16, 2016, at 10:03 PM, Ruslan Kabatsayev <b7.10110111 at gmail.com> wrote:
>>
>> On Tue, Aug 16, 2016 at 10:30 PM, Ken Thomases <ken at codeweavers.com> wrote:
>>> On Aug 16, 2016, at 1:57 PM, Ruslan Kabatsayev <b7.10110111 at gmail.com> wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I'm trying to integrate my program into Wine source and having some
>>>> difficulties with doing OpenGL calls. Namely, when I compile the
>>>> program with mingw and with winegcc, it works flawlessly. But when I
>>>> integrate it into Wine source tree (taking regedit as an example),
>>>> stack appears smashed after OpenGL calls.
>>>
>>>> Apparently in-tree compilation assumes another calling convention for
>>>> glLightModelfv here...
>>>> What could be the reason for this? How should I set up my Makefile.in
>>>> so that it generated a result compatible with opengl32 calling
>>>> convention?
>>>
>>> What headers are you including in the C code?  This is probably a result of not having the proper declarations, which would be decorated with calling convention specifications.
>>
>> As I can see, the system <GL/gl.h> header is included (visible when I
>> add an extra function argument and see the file referred to by the
>> compiler in its error message). But I don't find gl.h in Wine source
>> tree, so I guess this should be OK, no?
>
> You need to *not* include the system header and instead include <wgl.h> and, usually, <wglext.h>.

OK, this does appear to work. But I seem to now have to manually
declare gluPerspective and other GLU functions I use, since Wine
doesn't have anything like <wglu.h>, and the system header <GL/glu.h>
conflicts with <wine/wgl.h> and <wine/wglext.h>. Am I missing
something?

>
> -Ken
>



More information about the wine-devel mailing list