Wednesday, June 01, 2005

VTK installation: Oh happy Gawai!

At last, after 2 weeks of trying to solve the VTK installation problems on my PC in the lab, thanks to a friend, Raj, without his help, I think I will still trying to figure out the problems maybe for the next 3 years.

His advice were:
1. Reinstall Visual Studio.net Ver 7
2. No need to change the properties in Visual Studio Net., unlike VS6
3. Remember to always configure and generate CMake (patch 6 is the latest)
4. Before you configure and generate CMake, delete all the directories and files in c:\vtkbin
5. After generating CMake (by creating 2 directories) , then build VTK.sln (under 'Release' solution configuration)
6. Run the examples given in the Example/Tutorial directory (refer to the VTK user's guide book)
7. Generate your own CMakeLists. Below is the sample. Caps-lock is very important. Save it as CMakeLists.txt (in the same directory as the CONE directory).

PROJECT (CONE)
INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (VTK_FOUND)
INCLUDE_DIRECTORIES (${VTK_INCLUDE_DIRS})
LINK_DIRECTORIES (${VTK_LIBRARY_DIRS})
ENDIF (VTK_FOUND)
ADD_EXECUTABLE (CONE Cone.cxx)TARGET_LINK_LIBRARIES(CONE vtkCommon vtkGraphics vtkRendering)

8. Make sure the path you set in your system path (in the control panel-System-Advanced-environment variable-system variable) is correct. Eg type-in C:\vtkbib\bin\release
You won't want any linking problems later.
**NoTE:: in the CMAKE2.0, the cache value for VTK_DIR should be c:/vtkbin...*** Important**
If it doesn't work, try to copy all the vtk*.dll into the same directory as your solution (e.g here is CONE). This is not a good way of solving the problem. best to solve the linking problems.
9. Finally, you will find in the directory a *.sln file. Double click to open then build it. To render, go to the directory (as set in your CMake). There you will see an executable file. Double click on it and voila...it works!!
Phew...
God is good indeed. Now I gotta start understanding the pipeline and how to program in VTK.

Another advice by Dr Raj: QT can be used to create the GUI in VTK. At the moment, QT runs in unix. Maybe next month, we will get the windows version.
Thanks again Raj. Appreciate u.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?