I download vtk9.4.0 source,when compiled openxr project demo,show some error,that cant link.
read source,this define as this:
#define glad_glBlitFramebuffer vtk_glad_glBlitFramebuffer
but i cant find vtk_glad_glBlitFramebuffer Implementation.someone can give suggestion.
Hello,
Can you, please, redirect the output messages during VTK build to a text file and share it here?
best,
PC
Can you share the error messages?
Have you linked your demo to VTK::glad
or VTK::RenderingOpenGL2
atleast?
I have been compiled vtk9.4.0 that not error,contain vtkglad library. my demo dont directly use glad,which is openxr project. vtk9.3.0 is good,now compile it failed. some error as :
vtkXRInterfaceHelper.obj : error LNK2001: unresolved external symbol vtk_glad_glBlitFramebuffer
That’s a linker error. It means a library was not found or doesn’t have the mentioned symbol. That error could be the last of long chain of errors that may have started long before that. The best practice in solving unclear building errors is to look for the very first error that showed up during VTK’s lengthy build. Hence, I have to insist: Can you, please, redirect the output messages during VTK build to a text file and share it here? Without the full log it is very difficult to diagnose the problem.
LNK2001
is a typical Visual Studio error.
Please, refer to this: visual studio - What is the default location for MSBuild logs? - Stack Overflow on how to get a build log from MSBuild.
If you are using nmake
or cl
in a command line, just enter a [your command line] > my_build_log.txt 2>&1
. This command will redirect the output (both regular and errors) to a file called my_build_log.txt
instead of printing them to the screen. That file can then be shared here for analysis.
Where is this vtkXRInterfaceHelper.obj
object file coming from? There is no source file named vtkXRInterfaceHelper.cxx
in VTK. As always, when you have linker errors, please read the entire build output and share it here so we can help you fix the issue
Is your project available on github or elsewhere, so that we can look at your build system files?
thanks,vtkXRInterfaceHelper is my demo,not at github,I use Qt and compile type MSVC,dont show more error info.i read vtk source ,dont find vtk_glad_glBlitFramebuffer implementation,so i want to known reason.
It is in there. The linker error is likely because you most likely relied on indirect dependency linking? Can you share the compiler error?
vtk_glad_glBlitFramebuffer
is the expanded result of the glad_glBlitFramebuffer
symbol - https://gitlab.kitware.com/vtk/vtk/-/blob/master/ThirdParty/glad/vtkglad/include/glad/vtk_gl_mangle.h#L790 This is called mangling third party symbols. VTK does it so that the function doesn’t conflict with another glad library that could be used in an end user application.
glad_glBlitFramebuffer
a function pointer, loaded at runtime by glad here https://gitlab.kitware.com/vtk/vtk/-/blob/master/ThirdParty/glad/vtkglad/src/gl.c#L4225
Thanks for your reply.I read my code again,find that glBlitFramebuffer be used in my project.when it was removed,compling is good.if i want to use glBlitFramebuffer ,shoud use which function to replace?
Include vtk’s glad header and then use it.
#include <vtk_glad.h>
...
...
glBlitFramebuffer(....)
Add header #include<vtk_glad.h>,error still exist.
#define glad_glBlitFramebuffer vtk_glad_glBlitFramebuffer
this define is mean that i think glad_glBlitFramebuffer is defined as vtk_glad_glBlitFramebuffer ,so vtk_glad_glBlitFramebuffer must be impleted?
That’s not how mangling works. The glad_glBlitFramebuffer
is defined as vtk_glad_glBlitFramebuffer
so as to avoid calling an external glad_glBlitFramebuffer
.
As I said earlier, these are not declared as functions. They are function pointers that are initialized and assigned to function pointers from the OpenGL driver when glad is loaded.
Is your VTK 9.4.0 built as static or shared libraries?
Can you share project files privately, if not on github?
shared libraries,you can use any code,and insert glBlitFramebuffer(0,0,0,0,0,0,0,0,0,0) in this code,then can try to complie it by MSVC.