[IGSTK-Users] running application : Problem compiling ITK 3.0.1 with Visual Studio 2005

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 26 09:24:56 EDT 2007


Hi Somayeh,

Thanks for letting us know that you managed to build IGSTK.

The warnings that you are getting are normal, and you can safely
ignore them by now.

Visual Studio 2005 has an extra level of warnings related to
deprecation of certain methods, for which VS provides replacements.
These replacements, however, are not portable, and therefore we
have not adopted them.

Arguably, we could use macros in order to adopt the replacements
only in Windows...

For more details on the deprecation warnings you may want to
read the following article:

http://msdn.microsoft.com/vstudio/tour/vs2005_guided_tour/VS2005pro/Framework/CPlusSafeLibraries.htm


"Visual C++ 2005's C runtime library (CRT) provides new functions that 
address security flaws with the design of many functions in the Standard 
C library. The new, safer library functions perform many checks, such as 
validating incoming parameters, checking buffer sizes, ensuring null 
termination, and checking format string syntax."


In ITK we have disabled this warning by using the
_CRT_SECURE_NO_DEPRECATE definition. We could consider
doing the same thing in IGSTK, but probably a better way
to proceed is to define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
so that Visual Studio will replace the names with the "safer"
implementations.



    Regards,



       Luis



-----------------------
somayeh khademi wrote:
> Hello Luis,
> thanks for your attention,
>  
> All my problemI to be solved ,I can run the IGSTK application now.
> but I had some *warning* during compiling ITK,VTK,FLTK and IGSTK ,But I 
> can run the application without problem.Are these warning important?
> these warning are about some function of c library!.
> what is the reason?
> I attach the output_build of ITK,VTK,FLTK and IGSTK for you if you want 
> see them.
>  
> thanks.
> 
>  
> On 8/21/07, *Luis Ibanez* <luis.ibanez at kitware.com 
> <mailto:luis.ibanez at kitware.com>> wrote:
> 
> 
>     Hi Somayeh,
> 
>     Thanks for the additional details.
> 
> 
>     Please note that:
> 
>     1) VTK is a library, there are no executables in it.
>     2) ITK is a library, there are no executables in it.
> 
> 
>     Only if you enable the building of "Examples" or the
>     building of "Test" in ITK or VTK, then you will have
>     executables to run. However, these executables are
>     intended just to demonstrate the use of the libraries,
>     they are just additional material to the libraries.
> 
> 
> 
>     You seem to be confusing the term *"debugging"* with
>     the term *"compiling"*. Building means to *"compile"*
>     Debugging means to *"run"* an executable in debug mode.
> 
>     What you need to do is to "Build" : ITK, VTK and FLTK.
> 
>     Then you can "Build" : IGSTK
>     and then you can test the IGSTK Examples.
> 
> 
>     If you are using visual studio, what you need to
>     select in the IDE is the option "Build" a project,
>     or use the shortcut of hitting the "F7" key.
> 
> 
>     DO NOT use the "F5" and DO NOT select "Debug".
> 
> 
>      From your previous emails I summarize the state
>     of your build in the following way:
> 
>     a) You are using Visual Studio 2005
>     b) You can build(compile) FLTK without errors
>     c) You can build(compile) VTK without errors
>     d) You are getting errors while building ITK.
> 
> 
>      From the error message that you get when building
>     ITK, one common suspect is that you may have
>     put the source code of ITK in a directory name
>     that is too long:
> 
>     E:\somin\setup file\ITK\InsightToolkit-3.0.1\InsightToolkit-3.0.1\
> 
>     I will suggest you to reduce it to something like:
> 
>     E:\somin\setup file\ITK-3.0.1
> 
>     Visual Studio is known to have problems when dealing
>     with long paths, because it has a low limit for the
>     number of characters used in the command line of the
>     compiler. The IDE usually fails to report the problem
>     correctly.
> 
> 
>     Once you complete your build of ITK, you will be able
>     to try compiling IGSTK.
> 
> 
>     Please give it a try to put the source code of ITK
>     is a directory with a smaller path, and let us know
>     if you still have any problems compiling ITK.
> 
> 
> 
>         Thanks
> 
> 
>            Luis
> 
> 
> 
>     ------------------------
>     somayeh khademi wrote:
>      > Hello,
>      > thanks luis for answer,
>      >
>      > Answer for your quistion:
>      >
>      > a) yes, I don`t have any compile error during VTK debuging,It
>     just ask
>      > me for executable file name.(that I don`t know where is the right
>      > executable file name for continue?)
>      >
>      > b) yes,I don`t have any problem with building FLTK, (after set the
>      > option in config.h file).
>      > I can run fluid.exe .
>      >
>      > I attach again buildlog.htm file of ITK for you.
>      >
>      > thanks.
>      >
>      >
>      > On 8/20/07, *Luis Ibanez* < luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>
>      > <mailto:luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>>> wrote:
>      >
>      >
>      >     Hi Somayeh,
>      >
>      >     Let's go in order:
>      >
>      >     1) You *CAN NOT* build IGSTK until you have
>      >        built ITK and VTK.
>      >
>      >     2) You say that you are "debugging" ITK, but
>      >        from the error messages it seems that you
>      >        have not finished "building" ITK.
>      >
>      >     3) Thanks for sending the BuildLog.htm.
>      >        Unfortunately you are using a character
>      >        set that is not readable in the email.
>      >
>      >
>      >     It seems that your compiler is not properly
>      >     installed and/or configured...
>      >
>      >
>      >     Please answer the following questions:
>      >
>      >
>      >       a) Were you able to build VTK 5.0.3
>      >          with your VS2005 compiler without
>      >          getting any errors ?
>      >
>      >
>      >       b) Were you able to build FLTK
>      >          with your VS2005 compiler without
>      >          getting any errors ?
>      >
>      >
>      >
>      >
>      >     Please let us know.
>      >
>      >
>      >         Thanks
>      >
>      >
>      >
>      >            Luis
>      >
>      >
>      >
>      >     -------------------------
>      >     somayeh khademi wrote:
>      >      > thanks for your answer,
>      >      >
>      >      > I do it but I have a problem,
>      >      > (I use vtk 5.0.3 , ITK 3.0.1 , FLTK 1.1.7. and IGSTK 2.0.1)
>      >      >  when I debug vtk with vs2005 after some hours,It show me
>     a box
>      >     that ask
>      >      > me for executable file name for debug session.I don`t know
>     which .exe
>      >      > file and from where I must loaded?
>      >      >
>      >      > and in debuging ITK , show me the error box .(345 error
>     show in
>      >     output
>      >      > box),the first error that be shown is:
>      >      > E:\somin\setup
>      >      >
>      >    
>     file\ITK\InsightToolkit-3.0.1\InsightToolkit-3.0.1\Utilities\vxl\vcl\vcl_complex.h
> 
>      >     (66)
>      >      > : fatal error C1017: invalid integer constant expression
>      >      >
>      >      > and another error is:
>      >      >
>      >      > Project : error PRJ0002 : Error result -1073741819
>     returned from
>      >      > 'D:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.exe'.
>      >      >
>      >      > the build log file to be attached.(please see it)
>      >      >
>      >      > please tell me for solving these problems.
>      >      >
>      >      > thanks.
>      >      >
>      >      >
>      >      >
>      >      > On 8/18/07, *Luis Ibanez* < luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>
>      >     <mailto: luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>>
>      >      > <mailto:luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>
>      >     <mailto: luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>>>> wrote:
>      >      >
>      >      >
>      >      >     Hi Somayeh,
>      >      >
>      >      >
>      >      >                Welcome to IGSTK !
>      >      >
>      >      >
>      >      >     Yes, you need to build ITK and VTK before
>      >      >     you attempt building IGSTK.
>      >      >
>      >      >     All of these toolkits should first be
>      >      >     configured with CMake.
>      >      >
>      >      >     As GUI library you can use FLTK or QT.
>      >      >
>      >      >
>      >      >     Please read the instructions in the IGSTK book:
>      >      >
>      >      >         http://www.igstk.org/papers/IGSTKTheBook.pdf
>      >      >
>      >      >
>      >      >     You will also find build instructions in the
>      >      >     IGSTK Wiki page:
>      >      >
>      >      >
>      >     http://public.kitware.com/IGSTKWIKI/index.php/How_to_build_IGSTK
>      >     <
>     http://public.kitware.com/IGSTKWIKI/index.php/How_to_build_IGSTK>
>      >      >
>      >    
>     <http://public.kitware.com/IGSTKWIKI/index.php/How_to_build_IGSTK
>     <http://public.kitware.com/IGSTKWIKI/index.php/How_to_build_IGSTK>>
>      >      >
>      >      >
>      >      >       Please let us know if you find any problems
>      >      >       while building IGSTK.
>      >      >
>      >      >
>      >      >          Thanks
>      >      >
>      >      >
>      >      >             Luis
>      >      >
>      >      >
>      >      >     ========================
>      >      >     somayeh khademi wrote:
>      >      >      > Hello,
>      >      >      >
>      >      >      > I`m new in use IGSTK, please tell me for use IGSTK ,
>      >      >      > Is It nessecery *building* ITK,VTK, and FLTK after
>      >     configure them
>      >      >     with
>      >      >      > CMAKE ?or It is enough building the application , after
>      >     configure ?
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >
> 
> 
> 

> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(110) : warning C4996: 'strcpy' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
>         Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(114) : warning C4996: 'getenv' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h(483) : see declaration of 'getenv'
>         Message: 'This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(118) : warning C4996: 'strcpy' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
>         Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(123) : warning C4996: 'strcpy' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
>         Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(148) : warning C4996: 'strcat' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(78) : see declaration of 'strcat'
>         Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(152) : warning C4996: 'strcat' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(78) : see declaration of 'strcat'
>         Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(157) : warning C4996: 'strcpy' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(73) : see declaration of 'strcpy'
>         Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> E:\somin\VTK\vtk-5.0.3_s\Common\Testing\Cxx\vtkTestUtilities.h(162) : warning C4996: 'strcat' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(78) : see declaration of 'strcat'
>         Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> ..\..\..\..\..\vtk-5.0.3_s\Examples\Modelling\Cxx\finance.cxx(143) : warning C4996: 'fopen' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(234) : see declaration of 'fopen'
>         Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> ..\..\..\..\..\vtk-5.0.3_s\Examples\Modelling\Cxx\finance.cxx(149) : warning C4996: 'fscanf' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(249) : see declaration of 'fscanf'
>         Message: 'This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> ..\..\..\..\..\vtk-5.0.3_s\Examples\Modelling\Cxx\finance.cxx(199) : warning C4996: 'fscanf' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(249) : see declaration of 'fscanf'
>         Message: 'This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> ..\..\..\..\..\vtk-5.0.3_s\Examples\Modelling\Cxx\finance.cxx(201) : warning C4996: 'fscanf' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(249) : see declaration of 'fscanf'
>         Message: 'This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> ..\..\..\..\..\vtk-5.0.3_s\Examples\Modelling\Cxx\finance.cxx(208) : warning C4996: 'fscanf' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(249) : see declaration of 'fscanf'
>         Message: 'This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> ..\..\..\..\..\vtk-5.0.3_s\Examples\Modelling\Cxx\finance.cxx(217) : warning C4996: 'fscanf' was declared deprecated
>         D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(249) : see declaration of 'fscanf'
>         Message: 'This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> 



More information about the IGSTK-Users mailing list