From: Karl S. <k.w...@co...> - 2007-08-04 15:29:05
|
I think my source tree is badly out of date - need to update it. But quickly, BUILD_GL32 is used to build the library, so dll_export makes sense. _DLL is used to build apps that use the library, so dll_import is ok. If neither of the above two are defined, then it is the static case. For the static case I think, after looking at some older versions, we do not want to specify either dll_import or dll_export and instead use extern. In this case, using extern would make sense for both building the static lib itself, and for building an app that uses the static lib. You'll have to jiggle the headers to make that happen. Let us know if you get it to work. I'm too tangled up over the next couple of weeks to look into it myself, but would be happy to follow-up after that. Karl On 8/2/07, Mar...@be... <Mar...@be...> wrote: > > Hi Karl, > > > > The only place I can find references to dllimport is in glheader.h. I > think you may have meant WGLAPI instead of GLAPIENTRY? The relevant > preprocessor section from glheader.h is below (I've bolded the section I'm > curious about): > > > > # if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) > /* tag specify we're building mesa as a DLL */ > > # define WGLAPI __declspec(dllexport) > > # elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* > tag specifying we're building for DLL runtime support */ > > # define WGLAPI __declspec(dllimport) > > *# else /* for use with static link lib build of Win32 edition only */* > > *# define WGLAPI __declspec(dllimport)* > > *# endif /* _STATIC_MESA support */* > > > > Shouldn't, if we want static support, this be declared as something > different than dllimport? > > > > Thanks, > > Mark Schlosser > > > > > ------------------------------ > > *From:* kar...@gm... [mailto:kar...@gm...] *On > Behalf Of *Karl Schultz > *Sent:* Wednesday, August 01, 2007 6:33 PM > *To:* Mark Schlosser - Intern > *Cc:* mes...@li...; Karin Smith; George Smith > *Subject:* Re: [Mesa3d-users] Static library of Mesa on Windows? > > > > Oh, you'll have to do what it takes to make the mesa/gl headers define > GLAPI_ENTRY and friends correctly for static libs. (This is off the top of > my head, so details may be wrong) GLAPI_ENTRY is probably defined to > declspec(dllimport) or something like it and it gets put into all the gl > function prototypes. On linux-like systems it is usually blank.. You'll > need to examine all the files in the include directory and see if there is a > preprocessor define that controls whether mesa is compiled as a DLL or > static lib. > > BUILD_GL32 might be one of the controlling variables. Find it in the > include files and you will be in the right area. > > On 8/1/07, *Mar...@be...* <Mar...@be...> > wrote: > > Thanks so much for your quick response, Karl. > > > > I've taken your advice of starting with an empty template for building > static libraries. I am, however, getting some trouble with functions being > declared as dllimports, as below: > > > > c:\mesa\mesa-7.0\src\mesa\glapi\glapitemp.h(84) : error C2491: 'glNewList' > : definition of dllimport function not allowed > > > > In the DLL Mesa Solution we have these Preprocessor defines set up: > > _DEBUG > > WIN32 > > _LIB > > _DLL > > BUILD_GL32 > > MESA_MINWARN > > > > I got rid of _DLL; is there anything else I should know to put in here to > make Mesa know that we're trying to build statically? > > > > Thanks for your help. > > > > Mark > > > ------------------------------ > > *From:* kar...@gm... [mailto: kar...@gm...] *On > Behalf Of *Karl Schultz > *Sent:* Wednesday, August 01, 2007 4:51 PM > *To:* Mark Schlosser - Intern > *Cc:* mes...@li...; Karin Smith; George Smith > *Subject:* Re: [Mesa3d-users] Static library of Mesa on Windows? > > > > You're on the right track. There are a LOT of settings in the Visual > Studio that control this. Although tedious, one sure-fire approach would be > to start with an empty project for building a static .LIB and add all the > mesa source files to it, using the DLL project as a guide for which files to > add and what compiler options to use. But be careful not to use any options > for dynamic libs. > > Another approach is to make a small test project for a static .LIB and > compare the settings with a dynamic lib project. You can look at the text > project files. Then try modifying the original project using what you > learned from the comparison. > > You're probably just missing one of these items. > > On 8/1/07, *Mar...@be...* < Mar...@be...> > wrote: > > Hi, > > > > I'm interested in building a static library (.lib) version of Mesa on > Windows that we can link in directly to an application, thus bypassing the > need to have OPENGL32.DLL. > > > > However, from README.WIN32 regarding the VC8 solution file: > > "Static LIB files are not built. The LIB files that are built with are > the linker import files associated with the DLL files." > > > > I attempted to change the Visual Studio project's configuration to produce > static libraries instead of DLLs, but the libraries it produces are still > only linker import files. > > > > What would I have to do to get static libraries of Mesa built on Windows? > I appreciate any pointers. > > > > Thanks, > > Mark Schlosser > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Mesa3d-users mailing list > Mes...@li... > https://lists.sourceforge.net/lists/listinfo/mesa3d-users > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Mesa3d-users mailing list > Mes...@li... > https://lists.sourceforge.net/lists/listinfo/mesa3d-users > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Mesa3d-users mailing list > Mes...@li... > https://lists.sourceforge.net/lists/listinfo/mesa3d-users > > |