From: <Mar...@be...> - 2007-08-08 14:41:39
|
Hi Karl, =20 Success! I got a static lib of Mesa up and running on Windows. =20 =20 I had to change around //src/mesa/main/glheader.h and //include/gl/gl.h. Like you mentioned, in the static case, glheader.h should define WGLAPI as extern not as __declspec(dllimport). So I changed that, but then I still had some problems. =20 It seems that even when I don't specifiy _DLL and BUILD_GL32 as preprocessor options, they still get defined somewhere, so I added a new check for MESA_STATIC_WIN32 in glheader.h and gl.h, which conditionally undefines the _DLL and BUILD_GL32 macros if they exist. Then when I include GL/gl.h in my application, I just make sure to define MESA_STATIC_WIN32 beforehand (so the included entrypoints are extern). I could also pass MESA_STATIC_WIN32 as a preprocessor compiler option. =20 Here are diffs of my changes to the headers. =20 $ diff 7.0.1-rc1/glheader.h mychanges/glheader.h 97a98,106 > #ifdef MESA_STATIC_WIN32 > # ifdef _DLL > # undef _DLL > # endif > # ifdef BUILD_GL32 > # undef BUILD_GL32 > # endif > #endif >=20 117c126 < # define WGLAPI __declspec(dllimport) --- > # define WGLAPI extern 120d128 <=20 =20 $ diff 7.0.1-rc1/gl.h mychanges/gl.h 52a53,61 > #ifdef MESA_STATIC_WIN32 > # ifdef _DLL > # undef _DLL > # endif > # ifdef BUILD_GL32 > # undef BUILD_GL32 > # endif > #endif >=20 =20 |