Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
milkpku opened this issue Sep 7, 2016 · 5 comments
Closed

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

milkpku opened this issue Sep 7, 2016 · 5 comments

Comments

@milkpku
Copy link

milkpku commented Sep 7, 2016

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
Copy link

@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
Copy link
Author

milkpku commented Sep 18, 2016

@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
Copy link

@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
Copy link
Author

milkpku commented Sep 18, 2016

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

@kgupta15
Copy link

kgupta15 commented May 4, 2019

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants