dgpdec / course

Source code for the applications presented in the course "Geometry Processing with Discrete Exterior Calculus"
533 stars 92 forks source link

Compile issue with MSVC++ build tools on Win 10 64-bit #3

Open plumdeq opened 7 years ago

plumdeq commented 7 years ago

Hello,

I've been struggling to compile the examples from this repository on Windows 10 64-bit with the MSVC++ build tool chain (cl.exe, link.exe, nmake.exe). Some things are broken (e.g., UF_long types which should be SuiteSparse_long, thanks to the parallel thread for solution)... I think the most challenging part right now is actually to make opengl behave nicely... All the declarations regarding vertex and fragment shaders (e.g., glDeleteProgram) are breaking... On MacOS X all the opengl stuff works like charm though...

Maybe I need the opengl loader libraries like gl3w or something? By the way almost identical errors with MinGW build tool chain...

I am using the freeglut library instead of glut.

Real.cpp                                                                                                                                                      
[ 69%] Building CXX object CMakeFiles/ddg.dir/src/Shader.cpp.obj                                                                                              
Shader.cpp                                                                                                                                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(20): error C3861: 'glDeleteProgram': identifier not found                                   
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(22): error C3861: 'glDeleteShader': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(23): error C3861: 'glDeleteShader': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(24): error C3861: 'glDeleteShader': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(29): error C2065: 'GL_VERTEX_SHADER': undeclared identifier                                 
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(34): error C2065: 'GL_FRAGMENT_SHADER': undeclared identifier                               
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(50): error C3861: 'glLinkProgram': identifier not found                                     
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(54): error C3861: 'glUseProgram': identifier not found                                      
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(59): error C3861: 'glUseProgram': identifier not found                                      
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(79): error C3861: 'glCreateProgram': identifier not found                                   
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(84): error C3861: 'glDetachShader': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(87): error C3861: 'glCreateShader': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(89): error C3861: 'glShaderSource': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(91): error C3861: 'glCompileShader': identifier not found                                   
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(93): error C2065: 'GL_COMPILE_STATUS': undeclared identifier                                
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(93): error C3861: 'glGetShaderiv': identifier not found                                     
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(97): error C3861: 'glAttachShader': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(103): error C2065: 'GL_INFO_LOG_LENGTH': undeclared identifier                              
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(103): error C3861: 'glGetShaderiv': identifier not found                                    
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(107): error C2065: 'GLchar': undeclared identifier                                          
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(107): error C2065: 'infoLog': undeclared identifier                                         
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(110): error C2065: 'infoLog': undeclared identifier                                         
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(110): error C3861: 'glGetShaderInfoLog': identifier not found                               
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(112): error C2065: 'infoLog': undeclared identifier                                         
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(114): error C2065: 'infoLog': undeclared identifier                                         
C:\XXX\ddg-crane\BaseCode\src\Shader.cpp(114): error C2541: 'delete': cannot delete objects that are not pointers                    
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe' : return code '0x2'                                                                         
Stop.                                                                                                                                                         
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'                                       
Stop.                                                                                                                                                         
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'                                       
Stop.
plumdeq commented 7 years ago

It sucks to reply to your own question, but maybe it will be helpful to anyone following the same route.

I think that the code will have to be properly ported to work with MSVC or MinGW build tool chain... Has anybody actually succeeded in compiling and running it under Cygwin?

dud3 commented 7 years ago

Strangely I only get glDeleteShader identifier not found on VS 15. ;(