Hi,
 
This morning, I got Mesa 6.4.1 and tried to compile it with VC7.1
I faced the same error as you, but adding the scopes around the macro does not solve the problem.
 
Stephane
 
(BTW, I defined CHAN_BITS to 32 and TRIANGLE_WALK_DOUBLE to 1 in config.h)
 
 


From: mesa3d-users-admin@lists.sourceforge.net [mailto:mesa3d-users-admin@lists.sourceforge.net] On Behalf Of Kovalan Muniandy
Sent: Monday, December 12, 2005 7:22 PM
To: mesa3d-users@lists.sourceforge.net
Subject: [Mesa3d-users] Compilation and Link fails when using VC7


Hi,

I am trying to build MesaGL on Win32 using VC7. Issues encountered:

A) I am unable to solve the following linkage problem:

------ Build started: Project: osmesa, Configuration: Debug Win32 ------

Linking...
..\..\..\..\src\mesa\drivers\osmesa\osmesa.def(1) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
   Creating library .\Debug/OSMESA32.lib and object .\Debug/OSMESA32.exp
driverfuncs.obj : error LNK2019: unresolved external symbol __tnl_program_string referenced in function __mesa_init_driver_functions
Debug/OSMESA32.DLL : fatal error LNK1120: 1 unresolved externals

BTW, why do I need OSMESA32.DLL?

B) I had compilation problem in mesa and osmesa projects which I managed to fix .

The problem was due to declaration of temporary variable "GLuint i" when using macro RENDER_SPAN. Placing scopes around the macro solves the problem:

                #define RENDER_SPAN( span )                                \
Added Scope -> {\
                   GLuint i;                                                \
                   GLuint *img = (GLuint *) PIXELADDR4(span.x, span.y);        \
                   for (i = 0; i < span.end; i++) {                        \
                      const GLdepth z = FixedToDepth(span.z);                \
                      if (z < zRow[i]) {                                \
                         img[i] = pixel;                                \
                         zRow[i] = z;                                        \
                      }                                                        \
                      span.z += span.zStep;                                \
                   } \
Added Scope -> }
        #include "swrast/s_tritemp.h"

Ps. Microsoft compiler doesn't like defining a variable in the middle of a scope when it compiles C code.

Kovalan