[Insight-users] Problem with the HelloWorld Program

Rainbowfrog at web.de Rainbowfrog at web.de
Sun Aug 14 09:07:19 EDT 2005


Hello

I know problems like this have been mentioned before ,for example in this thread:

http://public.kitware.com/pipermail/insight-users/2003-May/003543.html

I have read that I shouldn't mix compilation modes, but still I have problems to get the 'Hello World' example of Itk running. I'm using Microsoft Visual Studio 6.0 and as far as I can say I followed the instructions in the manual when I installed ITK:
I opened Cmake, made sure that the "Build for" option was set to Visual Studio 6 , selected the Folder where I had unzipped Itk as "source" , and a new folder as "binary" direction, and I turned BUILD TESTING = OFF and BUILD EXAMPLES = OFF.
I pressed "configure" and later "Ok" when Cmake had finished the out of source build - no problem so far. I saved the HelloWorld.cxx Program and the CmakeLists.txt (which contain the code copied from the manual) to a new folder "HelloWorld".

Then I tried to get HelloWorld running in two different ways:

At the beginning I didn't notice that it is neccessary to open the Itk project in Visual Studio and build it there (I thought building it with Cmake would be enough). So I skipped this part and opened Cmake again, selecting the "HelloWorld" folder as source and as binary directory (in source build), and set ITK_DIR to my ITK binary directory,and surprisingly - though ITK had not been built correctly - Cmake didn't give me any error messages and create the HelloWorld.dsw .
When I opened it in Visual Studio and tried to build it , I got:


LINK : fatal error LNK1104: cannot open file "ITKCommon.lib"


Well , ok, I guess the reason for this is that in the first attempt I didn't build ITK in the visual studio before trying to build Hello World. However, if I do this first I get different problems: The build process for ITk didn't take 15-30 minutes like mentioned in the manual , but over 2 hours (and I have a computer with 2,8 GHZ). I guess this is because the compiler tries to build all the examples and tests as well though I had turned BUILD TESTING = OFF and BUILD EXAMPLES = OFF in CMake before.(Which should also be the reason why I then get many warnings when building ITK). My first question is: Which Checkboxes in the batchbuild dialog of the Visual Studio have to be unselected so that only the neccessary parts will be built ? 
After building ITK (which I think was successful despite some warnings that might be resulting from setting BUILD TESTING = OFF and BUILD EXAMPLES = OFF), when I now open Cmake and try to make a in source build for HelloWorld like I did before,this time Cmake has a problem with it.

First I get:


Cmake Error: Error in Cmake Code at
C:/Programme/Cmake20/Modules/FindItk.cmake:80:
INCLUDE Could not find include file: D:/DestItk/InsightToolkit-2.0.1./ITKConfig.cmake

(Press Cancel to suppress any further messages.)




When I click Ok the next error Window pops up:




CMake Error:Error in Cmake code at
D:/HelloWorld/CMakeLists.txt:5:
INCLUDE called with wrong number of arguments. Include takes only one file.


(Press Cancel to suppress any further messages.)



Next Error Window tells me:



CMake Error:Error in configuration process,project files may be invalid
(Press Cancel to suppress any further messages.)



At the moment I don't have any idea what the problem is or what I do wrong (except that I was compiling too much when I tried to build ITk in visual studio).
I always make sure that All_BUILD is set to be the active project in visual studio, and I set "ALL_BUILD -Win32 Debug" to be the active configuration for compiling.
I'd be glad if someone could help me with this.

Regards,
Philipp


_________________________________________________________________________
Mit der Gruppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle 
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179





More information about the Insight-users mailing list