[vtkusers] Problems with VS 2005 and VTK (vtkrendering.lib)
Obada Mahdi
omahdi at gmx.de
Wed Nov 1 11:48:23 EST 2006
Hi Markus!
On 11/1/06, mam06bhv <mam06bhv at studserv.uni-leipzig.de> wrote:
> I've solved the problem but now I got these errors in the VTK-window
Just for the record, what was the solution? It might be helpful to
others who search the mailing list and find themselves having a
similar problem.
> ERROR: In ..\..\VTK\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 824
> vtkWin32OpenGLRenderWindow (01970FD0): wglCreateContext failed in
> CreateAWindow(), error: 1114
>
> ERROR: In ..\..\VTK\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 824
> vtkWin32OpenGLRenderWindow (01970FD0): wglCreateContext failed in
> CreateAWindow(), error: 0
>
> ERROR: In ..\..\VTK\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 824
> vtkWin32OpenGLRenderWindow (01970FD0): wglCreateContext failed in
> CreateAWindow(), error: 6
I did a quick search in the mailing list archives for similar error
messages and found a reply from Mathieu Malaterre:
http://public.kitware.com/pipermail/vtkusers/2004-January/071401.html
Some other postings did not have replies or solutions, but it seems
that the problem is related to OpenGL drivers/libraries rather than
VTK. One suggestion for narrowing down the problem is to run other
OpenGL applications and see if they work. For example, start by
building VTK with "BUILD_EXAMPLES" set to "ON" and run one of the
examples, like "Cone". If it does not work, try other, non-VTK
programs that use OpenGL, and if they do not work either, it is very
likely a problem with your graphics card/OpenGL driver.
I also agree with Prename that you should consider using CMake for
creating your VisualStudio project. After seeing the same problems
reportet on the mailing like multiple times, I do not think that this
will make a difference--but the important point is that it is much
easier to understand the steps involved in building your project and
to eliminate some possibilities that might be a result of an
unconventional build setup.
Here is a sample "CMakeLists.txt" file that should be sufficient for
creating a VS8 Solution for your sample program (I called it
"markus-test.cc") using CMake:
[this is actually a stripped-down version of
"Examples/Medical/Cxx/CMakeLists.txt"]
----BEGIN----
PROJECT (markus-test)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ADD_EXECUTABLE(markus-test markus-test.cc)
TARGET_LINK_LIBRARIES(markus-test vtkRendering)
----END----
Just put this and "markus-test.cc" into the same directory, create a
build directory somewhere and use CMakeSetup.exe to create a VS8
Solution file. In the interactive configuratio process, you will need
to specify the location of the directory ".../lib/vtk-<version>" from
your VTK installation.
Regards
Obada
More information about the vtkusers
mailing list