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
Compilation errors for glewInit already defined, and GL calls result in Access Violation #70
Comments
Until you hear back from @mp3guy, the interim solution for me was to modify the Shader constructor to have pangolin check for a current context, create one if it didn't exist, and call glewInit();
|
@spyd3rweb ,hey,have you solved this problem?or how to do the modification you mentioned? |
@hitsjt Take the above code and save it as "static_glew_init.hpp" in your %GITHUB_DIR%\ElasticFusion\Core\src folder, and add it to the Headers filter under the efusion project in the libefusion solution. In "Shaders.h" add the include for "static_glew_init.hpp" and add a call to the staticGlewInit() function in the Shader constructor: `#ifndef SHADERS_SHADERS_H_ #include <pangolin/gl/glsl.h> class Shader : public pangolin::GlSlProgram |
@spyd3rweb
|
@hys2015 |
@hitsjt |
@spyd3rweb What do you mean by "install" in Suite Sparse step 8? Is there an installation step I need to do (I'm guessing this is comparable to a make install on linux)? I don't have an include or lib64 directory in suitesparse so I'm guessing that's why |
Oh I see, I had to explicitly build the "Install" project. |
@hys2015 Hi, how could you solve the problem ---- MakeCurrent: Not available with non-pangolin window. Could you explain more in detail please? Thank you in advance! |
@hys2015 How much should I lower this number? I tried 768 but still got the error. What value do you use? |
@spyd3rweb I managed to successfully compile Core and GUI on Windows 10 using VS 2017. I also copied all DLL files to same folder of ElasticFusion.exe. However when running ElasticFusion.exe, I got Ordinal Not Found error:
Any idea please? |
I'm having the "glewInit already defined" error, but I don't understand how to follow your instructions:
Where is "project properties for linker"? |
|
In the Solution Explorer, the only Project that has a Linker section in its Properties is
|
Hi, how could u solve this problem? I have the same problem but I cant find out where #7 is |
have u solved it? I cant find any solution. |
Could you please validate build instructions and appropriate glew linkage for ElasticFusion and libefusion?
Compilation warning/error(s):
Error LNK2005 glewInit already defined in efusion.lib(efusion.dll) ElasticFusion %GITHUB_DIR%\ElasticFusion\GUI\src\build\glewd.lib(glew.obj) 1
Error LNK1169 one or more multiply defined symbols found ElasticFusion %GITHUB_DIR%\ElasticFusion\GUI\src\build\Debug\ElasticFusion.exe 1
Which can be suppressed with /FORCE; however, running ElasticFusion.exe results in access violation, the culprit being glGenRenderbuffersEXT(1, &rbid) in:
A solution to resolve the linkage error without suppressing was documented (#65), which was to switch the order of the glew.lib library link. This solution and other various attempts to troubleshoot, including using glew static library linking, have allowed gl calls from within ElasticFusion.exe to proceed further into execution; however, eventually gl calls originating from efusion.dll would then fail with an access violation, the culprit being prog = glCreateProgram();
Likely unrelated, but the line ElasticFusion.exe!pangolin::GlRenderBuffer::GlRenderBuffer(int width, int height, int internal_format) Line 434 appears not to be properly terminated. Has "," instead of ";"
If the problem persists after I have confirmation from you that linkage within ElasticFusion and libefusion is correct for glew, I will create an issue with the maintainer of Pangolin.
There could be a potential issue for:
http://www.khronos.org/opengl/wiki/OpenGL_Loading_Library#Intialization_of_GLEW_1.13.0_and_earlier
GLEW up to version 1.13.0 has a problem with core contexts. It calls glGetString*GL_EXTENSIONS) which causes GL_INVALID_ENUM on GL 3.2+ core context as soon as glewInit() is called. It also doesn't fetch the function pointers. GLEW version 2.0.0+ uses glGetStringi instead. The only fix for earlier version is to use glewExperimental. If you are creating a GL context the old way or if you are creating a backward compatible context for GL 3.2+ then you don't need glewExperimental.
glewExperimental = GL_TRUE;
GLenum err=glewInit();
Build and Run procedures:
Suite Sparse for Windows 1.3.1
#set(SUITESPARSE_URL "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.4.3.tar.gz")
set(SUITESPARSE_URL "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.4.tar.gz")
OpenNI2 Kinect2 Branch
(I understand Kinect 2 is not currently supported by ElasticFusion, but once I get ElasticFusion running, I plan on creating a Kinect2 OpenNI2 driver that provides a color and depth of the same resolution)
LNK4075 ignoring '/EDITANDCONTINUE' due to '/OPT:LBR' specification
Pangolin
Elastic Fusion Core
Elastic Fusion GUI
SeverityCode Description Project File Line Suppression State
Error LNK2005 glewInit already defined in efusion.lib(efusion.dll) ElasticFusion %GITHUB_DIR%\ElasticFusion\GUI\src\build\glewd.lib(glew.obj) 1
Error LNK1169 one or more multiply defined symbols found ElasticFusion %GITHUB_DIR%\ElasticFusion\GUI\src\build\Debug\ElasticFusion.exe 1
Xcopy /F /Y "%GITHUB_DIR%\ElasticFusion\bin\efusion.dll" "%~dp0"
Xcopy /F /Y "%GITHUB_DIR%\Pangolin\build\external\zlib\bin\zlibd.dll" "%~dp0"
Xcopy /F /Y "%GITHUB_DIR%\OpenNI2\Bin\x64-Debug\OpenNI2.dll" "%~dp0"
Xcopy /F /Y /E /I "%GITHUB_DIR%\OpenNI2\Bin\x64-Debug\OpenNI2" "%~dp0\OpenNI2"
Xcopy /F /Y "%GITHUB_DIR%\suitesparse-metis-for-windows\lib64\lapack_blas_windows\libblas.dll" "%~dp0"
Xcopy /F /Y "%GITHUB_DIR%\suitesparse-metis-for-windows\lib64\lapack_blas_windows\liblapack.dll" "%~dp0"
Xcopy /F /Y "%GITHUB_DIR%\suitesparse-metis-for-windows\lib64\lapack_blas_windows\libgcc_s_sjlj-1.dll" "%~dp0"
Xcopy /F /Y "%GITHUB_DIR%\suitesparse-metis-for-windows\lib64\lapack_blas_windows\libgfortran-3.dll" "%~dp0"
Xcopy /F /Y "%GITHUB_DIR%\suitesparse-metis-for-windows\lib64\lapack_blas_windows\libquadmath-0.dll" "%~dp0"
The text was updated successfully, but these errors were encountered: