At 02:32 PM 1/27/2004 +0800, dominic wrote:
Hi all,
 
I've compiled the Mesa 6.0 library with VC.NET. Both the libraries and demos compiled successfully (the configuration is 'Active (Debug)'), although with a bit warning (I think it doesn't matter anyway, does it?).


The GLU libraries will generate a bunch of warnings when compiling the C++ parts of GLU.  There are a couple of issues here.
1) The C++ files in the GLU lib use the file extension ".cc".  The Visual Studio (ver 6) does not recognize this filetype as a C++ file and so I had to create some really clumsy custom build steps.  There is a way to convince the Visual Studio to treat .cc files as C++, but it involves some registry hacks and other unnatural actions.  I hope to improve this situation in the future.
2) The warnings themselves can probably be suppressed with some compiler options, but I didn't look into it that closely.  If someone can figure it out, I'll be glad to make the changes.


 
And then I tried to run the demo programs. Most of them run successfully, with a few exceptions: I've got error from the 'fire.exe' demo, and the 'isosurf.exe' demo. I captured the error messages, and you can view them in the following links:
 
(from fire.exe)
http://dominickwan.netfirms.com/mesa_error1.jpg
I just run the exe program and got this message.

A change was recently made to the Mesa source code to replace a malloc() call with calloc().  When you run a debug build, the allocated storage is filled with a pattern and the code checks to see if the data has ever been written to before it is first accessed.

You might try getting/making this change:

Log message:
  replace MALLOC w/ CALLOC to silence valgrind warnings

Modified files:
      Mesa/src/mesa/tnl/:       Tag: mesa_6_0_branch
        t_vertex.c
 
  Revision      Changes    Path
  1.10.2.1      +1 -1      Mesa/src/mesa/tnl/t_vertex.c

I only tested the build with VC 6, so that is why it didn't get noticed sooner.  I have VC 7 now, so I will start using it as well.

 
(from isosurf.exe)
http://dominickwan.netfirms.com/mesa_error2.jpg
For this case, the program could be executed. The error dialog comes out when I choose 'glArrayElement' in the pop up menu.

I'll look into this.  As another poster said, it is very likely a mismatched cdecl/stdcall issue.  My first guess after a VERY quick look at the code is that the typedefs for array_func and texarray_func need to be changed to include GLAPIENTRY in src/mesa/main/api_arrayelt.c.  You might try that to see how it works out until I can make the final fix.

 
All I've done to compile the library is open the .dsw file by VC.NET, and choose 'Build Solution' to build all of them. Is there any steps that I've missed, or should I tweak any settings in the compiler?  For your reference, I've put the build log on
http://dominickwan.netfirms.com/mesa_buildlog.txt.

No, you did it right.  I just was unable to check everything out on VC 7.  The projects were constructed on VC 6.

The OPT:NOWIN98 problem is due to something that changed between VC 6 and VC 7.  I'll have to look into that one too.

 
One more thing to mention is that I can never compile the library in Release mode. It always stops at 'image.c' without giving me any error messages... again, could anyone give me some hint on solving this?

Gee, I don't know about that one.  I'll look at it.  There must be some clue as to what happened.  Do the project files and settings look OK, especially as you compare debug vs release?

Karl