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

[Install Pangolin] excute command : cmake --build . (Error like this) #268

Closed
iDonghq opened this issue Jul 17, 2017 · 6 comments
Closed

Comments

@iDonghq
Copy link

iDonghq commented Jul 17, 2017

error: ‘GL_SHADER_STORAGE_BUFFER’ was not declared in this scope
GlShaderStorageBuffer = GL_SHADER_STORAGE_BUFFER

@Coldplayplay
Copy link

I have the same problem. I guess this is the problem of the opengl, but i dont know how to solve it.hope someone can help solve it.

@iDonghq
Copy link
Author

iDonghq commented Jul 18, 2017

Maybe not openGL, cause I have tested it; maybe the path of installation or the version of pangolin

@stevenlovegrove
Copy link
Owner

This is probably related to the version of your installed OpenGL, maybe GLEW. You can safely comment that line if you like and the rest should compile fine.

The best solution is probably to find some #define with the OpenGL version to guard against this in the future.

@glc12125
Copy link

@stevenlovegrove , you are right, I believe it is because of OpenGL version. Checked the documention of OpenGL, (https://www.khronos.org/registry/OpenGL-Refpages/gl4/), found that "The GL_DISPATCH_INDIRECT_BUFFER and GL_SHADER_STORAGE_BUFFER targets are available only if the GL version is 4.3 or greater.". And according to the source code, where the error was thrown:

/usr/local/include/pangolin/gl/gl.h:171:29: error: ‘GL_SHADER_STORAGE_BUFFER’ was not declared in this scope:

#ifndef HAVE_GLES
GlPixelPackBuffer = GL_PIXEL_PACK_BUFFER, // PBO's GlPixelUnpackBuffer = GL_PIXEL_UNPACK_BUFFER, GlShaderStorageBuffer = GL_SHADER_STORAGE_BUFFER #endif

This is introduced in this change: e66e204#diff-d382887f3e1d2d9afcea169f207a1381

I need to checkout a previous commit in order to compile. If OpenGL 4.3 is a prerequisite, we should force that in the building step. If not, this should be fixed.

@caselitz
Copy link
Contributor

caselitz commented Nov 13, 2017

In my case this problem occurred because I had ${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc in my cmake include_directories (to #include <helper_cuda.h>).

As there exists a directory GL, I suspect this causes pangolin/gl/glplatform.h to include the wrong <GL/glew.h>. At least removing this path from the include_directories solved the problem for me.

Edit: Indeed my /usr/include/GL/glew.h defines GL_SHADER_STORAGE_BUFFER while /usr/local/cuda-8.0/samples/common/inc/GL/glew.h does not.

@JerryOusama
Copy link

@caselitz Thank you for your infomation. I use </usr/include/GL/glew.h> instead of <GL/glew.h> to solve this problem.

@popsheng
Copy link

popsheng commented May 25, 2018

@caselitz I meet the same problem. It works by changing the <GL/glew.h> in pangolin/gl/glplatform.h using /usr/include/GL/glew.h.

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

7 participants