[Mesa-dev] Building Mesa for Windows using Visual Studio
Shervin Sharifi
shervin0 at gmail.com
Mon Apr 13 16:22:38 PDT 2015
Hi,
I tried to use Mesa (compiled with MSVC) to run OpenGL ES content on
Windows . I ran into a few problems.
I don't know if this is the right way of reporting issues, but thought
people may be interested to know.
Here's a piece of code in functions _mesa_dlopen(const char*, int) in
src\mesa\main\dlopen.h (same problem happens with function
_mesa_dlsym(void *, const char *) in the same file).
The original code returns NULL and doesn't load the library if the code is
compiled with Visual Studio.
#if defined(HAVE_DLOPEN)
flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */
return dlopen(libname, flags);
#elif defined(__MINGW32__)
return LoadLibraryA(libname);
#else
return NULL;
#endif
Adding the following lines to the code resolves the problem:
#elif defined(_WIN32)
return LoadLibraryA(libname);
Thanks,
Shervin
On Fri, Apr 3, 2015 at 5:38 PM, Shervin Sharifi <shervin0 at gmail.com> wrote:
> Thank you for useful information.
> I was able to build Mesa with VS 2013 with a similar scheme with scons.
>
> Thanks,
> Shervin
>
>
> On Fri, Apr 3, 2015 at 7:01 AM, Emil Velikov <emil.l.velikov at gmail.com>
> wrote:
>
>> On 3 April 2015 at 14:43, Predut, Marius <marius.predut at intel.com> wrote:
>> >>
>> >> Just a couple of small details - mesa has a fall-back for the
>> mentioned functions (plus others) in $(top)/include/*h.
>> >>
>> >> That said, I believe that the overall consensus is that building mesa
>> with MSVC 2008, is the bare minimum, with MSVC 2013 strongly recommended.
>> Afaik, as the VMWare guys give us the go ahead > > > we'll drop all the
>> workarounds for pre-2013 versions and bump the requirement.
>> >>
>> >> Cheers,
>> >> Emil
>> > Hmm, nice to know,
>> > but in this case the build system have to take in consideration and
>> this is a bug or ,
>> > by hand we should copy headers?
>> >
>> Not sure I fully understand your statement here. Currently there are
>> two types of headers - A) provide official (like) implementation, and
>> B) that wrap around existing ones.
>> Example:
>> A) include/c99/* provides stdint.h & co for MSVC 2012 and older as
>> they lack the headers.
>> B) include/c99_math.h provides compat wrapper, as MSVC 2013's math.h
>> is not in C99 land yet.
>>
>> About using those - everything is handled already. Where needed the
>> extra include is added by the build (for A) and where the code is
>> known to be build with MSVC a header from B is used rather than the
>> system one.
>>
>> Hope that clears things up.
>> Emil
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150413/f4b7a1ab/attachment-0001.html>
More information about the mesa-dev
mailing list