[vtkusers] CMake/Linking Issues VTK 6.1.0

Dan dbpvusrlist at hotmail.co.uk
Tue Jul 1 16:16:12 EDT 2014


Hmm, just tried removing it. It doesn't make a difference. If I type the correct install directory into the GUI it just resets when I press 'configure'. If I type it an they just click 'generate' it still gives the error about 'vtkalglib.lib'.

Dan

Date: Tue, 1 Jul 2014 15:59:59 -0400
Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0
From: christopher.mullins at kitware.com
To: dbpvusrlist at hotmail.co.uk
CC: vtkusers at vtk.org

Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure.

I suspect this is causing the problem.  Could you take it out of the CMakeLists.txt file and just provide it at configure time via cmake-gui? 


On Tue, Jul 1, 2014 at 3:56 PM, Dan <dbpvusrlist at hotmail.co.uk> wrote:




Hi Christopher,

Yes I have seen and read that page. The problem I am having is not building VTK itself, rather, building my own application which uses VTK. I have cobbled together a CMake file from scouring the VTK documentation / Google. It reads


cmake_minimum_required(VERSION 2.8.7)
project(Test)
set(VTK_DIR "C:/VTK-6.1.0/install")
find_package(VTK 6.1 REQUIRED NO_MODULE)
if(VTK_FOUND)
    message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR})

endif()
include(${VTK_USE_FILE})
add_executable(Test test.cpp)
target_link_libraries(Test ${VTK_LIBRARIES})

It configures fine and generates a Visual Studio solution I can open, but when I try and build this it throws a linker error saying


"cannot open input file 'vtkalglib.lib'"

Interesting to note is that in my install folder (specified while building VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure.


Regards,
Dan


Date: Tue, 1 Jul 2014 15:43:36 -0400
Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0
From: christopher.mullins at kitware.com

To: dbpvusrlist at hotmail.co.uk
CC: vtkusers at vtk.org

Have you checked out the wiki page for configuring and building [1] ?  It was written for VTK 6.1.0.  

Could you post which step you're trying to accomplish, and the errors you receive?  I think this will help us diagnose what's happening.


[1] http://www.vtk.org/Wiki/VTK/Configure_and_Build

On Tue, Jul 1, 2014 at 3:33 PM, Dan <dbpvusrlist at hotmail.co.uk> wrote:





Hi All,

I have been using VTK (version 5) for some time. I downloaded and built the source as detailed on the website, and then I was able to link to the libraries and include the header files manually as I usually do for third party libraries. Everything worked fine.



I'm now on a new system so I downloaded, configured and built VTK 6.1.0. It built fine and I installed it to the specified directory. However, I then found it impossible to manually link my VS project to the libraries. To get around this I tried using CMake to generate a Visual Studio project but nothing I try seems to work. A number of permutations each seem to give different errors, either include errors or linking errors. Some won't even configure with CMake!



Could someone please explain, in clear steps how one goes about building and linking to VTK?

Thanks very much,
Dan

(I'm not a novice but after three days trying to sort this out I'm out of ideas!)



 		 	   		  

_______________________________________________

Powered by www.kitware.com



Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html



Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ



Follow this link to subscribe/unsubscribe:

http://public.kitware.com/mailman/listinfo/vtkusers




-- 
Christopher MullinsR&D EngineerKitware Inc.,919.869.8871

 		 	   		  


-- 
Christopher MullinsR&D EngineerKitware Inc.,919.869.8871
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140701/8a1c60d1/attachment.html>


More information about the vtkusers mailing list