hello. to compile a mex file in matlab that requires glut and glew, I proceeded as follows:
-put. "lib" in "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ lib"
-put. "h" in "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ include \ GL"
-put "dll." in "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC \ bin" and "c: \ windows \ system32"

when i run the mex file i got the following errors:

mex -I./glew/include/GL -L./glew/lib -lglew32 -I./glut/include/GL -L./glut/lib -lglut32 MexGlutInit.cpp
MexGlutInit.cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\GL/glut.h(487) : error C2059: erreur de syntaxe˙: '('
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\GL/glut.h(487) : error C2143: erreur de syntaxe˙: absence de ';' avant '{'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\GL/glut.h(487) : error C2447: '{'˙: en-tˆte de fonction manquant (liste formelle … l'ancien format˙?)
// mex.m file
Code :
%%
% This is a matlab compilation script that will compile the Offscreen
% library
% Author: Tianli Yu, tianli@ieee.org, Mar 30, 2009
 
%%
% Please Modify these two path strings to point to the GLUT and GLEW library
% -I is the header file include path, -L is the binary lib path
%
[status, os] = system('uname');
 
% removes \n
os = os(1:end-1);
 
if strcmp(os, 'Darwin')
  %% Mac OS X
  GlewPath = '-I/opt/local/include -L/opt/local/lib -lGLEW';
  GlutPath = '-I/opt/local/include -L/opt/local/lib -lglut';
elseif strcmp(os, 'Linux')
  %% For Ubuntu Linux, just install libglew1.5 and libglew1.5-dev, freeglut
  %% is usually pre-installed
  GlewPath = '-lGLEW';
  GlutPath = '-lglut -lGL -lGLU';
else
 
  %% For Windows you could download the GLEW and GLUT binary and put them under
  %% the root of this toolbox, then use the following 
  GlewPath = '-I./glew/include/GL -L./glew/lib -lglew32';
  GlutPath = '-I./glut/include/GL -L./glut/lib -lglut32';
 
end
 
%% Compiling the source code
disp(['mex ' GlewPath ' ' GlutPath ' MexGlutInit.cpp']);
eval(['mex ' GlewPath ' ' GlutPath ' MexGlutInit.cpp']);
 
disp(['mex ' GlewPath ' ' GlutPath ' BatchFaceColorGradImpl.cpp']);
eval(['mex ' GlewPath ' ' GlutPath ' BatchFaceColorGradImpl.cpp']);
 
disp(['mex ' GlewPath ' ' GlutPath ' ProjectMesh2ImageImpl.cpp']);
eval(['mex ' GlewPath ' ' GlutPath ' ProjectMesh2ImageImpl.cpp']);
 
disp(['mex ' GlewPath ' ' GlutPath ' RenderColorMeshImpl.cpp']);
eval(['mex ' GlewPath ' ' GlutPath ' RenderColorMeshImpl.cpp']);
 
disp(['mex ' GlewPath ' ' GlutPath ' RenderDepthMeshImpl.cpp']);
eval(['mex ' GlewPath ' ' GlutPath ' RenderDepthMeshImpl.cpp']);
 
disp(['mex ' GlewPath ' ' GlutPath ' ShadowProj2Impl.cpp']);
eval(['mex ' GlewPath ' ' GlutPath ' ShadowProj2Impl.cpp']);

need help please