dgpdec / course

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

<iostream> missing and UF_long no longer be used #2

Closed milkpku closed 6 years ago

milkpku commented 8 years ago

Hi, dear contributers,

I downloaded this code in 2016 Sep 7, and find some error when compiling, maybe it is because the code is sort of old. I have fixed it by several adjustment:

My enviroment is Arch Linux

1) There is <iostream> missing in include/DenseMatrix.h and include/SpraseMatrix.h, just add #include <iostream> can fix it

2) UF_long is no longer used and is replaced by SuiteSprase_long, so I just replace UF_long in src/SpraseMatrix.cpp and src/SpraseMatrix.inl

3) all my SuiteSprase libs are .so file so there would be error undefined reffer to 'umfpack...' , simplily add -lumfpack to LIBFLAG can solve this problem

sincerely

tamarous commented 7 years ago

@milkpku Hi milkpku, I met the same error: In file included from src/DenseMatrix.cpp:1:0: ./include/DenseMatrix.h:158:4: error: ‘ostream’ in namespace ‘std’ does not name a type Have you figured out how to solve this problem?

milkpku commented 7 years ago

@tamarous did you add #includ <iostream> into these two head files? or you can try my fork of this repo at https://github.com/milkpku/course

tamarous commented 7 years ago

@milkpku Thank you for you repo! I tried it and errors mentioned above are solved.

However, there raises other errors like undefined reference to amd_l_valid and undefined reference to amd_l_defaults

I downloaded suiteparese and in its AMD/Lib directory I tried make, then the related .o files were generated. But I don't know how to link these .o files in Makefile. Any suggestions?

milkpku commented 7 years ago

@tamarous maybe you can use package manager (apt-get for Ubuntu or pacman for Arch ...) to install SuiteSparse rather than compiling by yourself

kgupta15 commented 5 years ago

@milkpku Hi, I edited the code using all your points, but I am having this error

src/Viewer.cpp: In static member function ‘static void DDG::Viewer::display()’:
src/Viewer.cpp:344:26: error: ‘glGetUniformLocation’ was not declared in this scope
       GLint uniformEye = glGetUniformLocation( shader, "eye" );
                          ^~~~~~~~~~~~~~~~~~~~
src/Shader.cpp: In destructor ‘DDG::Shader::~Shader()’:
src/Shader.cpp:20:21: error: ‘glDeleteProgram’ was not declared in this scope
       if( program ) glDeleteProgram( program );
                     ^~~~~~~~~~~~~~~
src/Viewer.cpp:345:7: error: ‘glUniform3f’ was not declared in this scope
       glUniform3f( uniformEye, eye[1], eye[2], eye[3] );
       ^~~~~~~~~~~
g++ -c src/Complex.cpp -o obj/Complex.o -O3 -Wall -Werror -ansi -pedantic   -I./include -I./src -I/usr/include/suitesparse -I/usr/include/GL -lglut -lGL -lGLU -lX11 -lspqr -lcholmod -lmetis -lcolamd -lccolamd -lcamd -lamd -lm -lumfpack -llapack -lblas -lgfortran
src/Viewer.cpp:345:7: note: suggested alternative: ‘glColor3f’
       glUniform3f( uniformEye, eye[1], eye[2], eye[3] );
       ^~~~~~~~~~~
       glColor3f
src/Shader.cpp:20:21: note: suggested alternative: ‘glResetHistogram’
       if( program ) glDeleteProgram( program );
                     ^~~~~~~~~~~~~~~
                     glResetHistogram
src/Shader.cpp:22:28: error: ‘glDeleteShader’ was not declared in this scope
       if(   vertexShader ) glDeleteShader(   vertexShader );
                            ^~~~~~~~~~~~~~
src/Shader.cpp:22:28: note: suggested alternative: ‘vertexShader’
       if(   vertexShader ) glDeleteShader(   vertexShader );
                            ^~~~~~~~~~~~~~
                            vertexShader
src/Shader.cpp:23:28: error: ‘glDeleteShader’ was not declared in this scope
       if( fragmentShader ) glDeleteShader( fragmentShader );
                            ^~~~~~~~~~~~~~
src/Shader.cpp:23:28: note: suggested alternative: ‘vertexShader’
       if( fragmentShader ) glDeleteShader( fragmentShader );
                            ^~~~~~~~~~~~~~

I changed all <GLUT/glut.h> to <GL/glut.h> and added <GL/gl.h> to the code. I added $(LIBS) at the end of this line, but that didn't work either. How can I solve this problem?