[Insight-users] Visual Studio .net 2003 and example
Oliveira Marcelo
marceloitk at yahoo.com.br
Tue Jul 13 09:07:53 EDT 2004
Hi Luis and All !!!
tank's for advanced me !!!!
I'm try to set my CmakeList with Visual Studio .NET 2003. So i create a simple Window Form Aplication (.NET). VS .NET
generated the following files - Form1.cpp, stdafx.cpp, app.rc,
AssemblyInfo.cpp, Form1.h, resource.h, stdafx.h. Then i tryed to set the CmakeList like this:
PROJECT( teste )
ADD_DEFINITIONS(-D_AFXDLL)
SET(CMAKE_MFC_FLAG 6)
SET(teste_SRCS
Form1.cpp
AssemblyInfo.cpp
app.rc
stdafx.cpp
)
IF(WIN32)
LINK_LIBRARIES(
wsock32
)
ENDIF(WIN32)
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR
"Cannot build without ITK. Please set ITK_DIR.")
ENDIF(ITK_FOUND)
INCLUDE_DIRECTORIES(C:/"Arquivos de programas/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include/")
INCLUDE_DIRECTORIES(C:/"Arquivos de programas/Microsoft Visual Studio .NET 2003/Vc7/Include/")
LINK_LIBRARIES(C:/"Arquivos de programas/Microsoft Visual Studio .NET 2003/Vc7/lib/")
ADD_EXECUTABLE (teste WIN32 ${teste_SRCS})
TARGET_LINK_LIBRARIES(teste ${ITK_LIBRARIES} )
Cmake execute without errors, but when i tryed to BUILD Solution, the sln made by Cmake, this error happen (tank's a lot for your help)
Output Window
Compiling...AssemblyInfo.cpp\Doutorado\teste\AssemblyInfo.cpp(3) : error C2653: 'System' : is not a class or namespace name\Doutorado\teste\AssemblyInfo.cpp(3) : error C2871: 'Reflection' : a namespace with this name does not exist\Doutorado\teste\AssemblyInfo.cpp(4) : error C2653: 'System' : is not a class or namespace name\Doutorado\teste\AssemblyInfo.cpp(4) : error C2871: 'CompilerServices' : a namespace with this name does not exist\Doutorado\teste\AssemblyInfo.cpp(11) : error C3746: 'AssemblyTitleAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(11) : error C2337: 'AssemblyTitleAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(12) : error C3746: 'AssemblyDescriptionAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(12) : error C2337: 'AssemblyDescriptionAttribute'
: attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(13) : error C3746: 'AssemblyConfigurationAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(13) : error C2337: 'AssemblyConfigurationAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(14) : error C3746: 'AssemblyCompanyAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(14) : error C2337: 'AssemblyCompanyAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(15) : error C3746: 'AssemblyProductAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(15) : error C2337:
'AssemblyProductAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(16) : error C3746: 'AssemblyCopyrightAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(16) : error C2337: 'AssemblyCopyrightAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(17) : error C3746: 'AssemblyTrademarkAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(17) : error C2337: 'AssemblyTrademarkAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(18) : error C3746: 'AssemblyCultureAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(18) :
error C2337: 'AssemblyCultureAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(31) : error C3746: 'AssemblyVersionAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(31) : error C2337: 'AssemblyVersionAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(55) : error C3746: 'AssemblyDelaySignAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(55) : error C2337: 'AssemblyDelaySignAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(56) : error C3746: 'AssemblyKeyFileAttribute': only custom attributes can be used on assemblies or
modules\Doutorado\teste\AssemblyInfo.cpp(56) : error C2337: 'AssemblyKeyFileAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace\Doutorado\teste\AssemblyInfo.cpp(57) : error C3746: 'AssemblyKeyNameAttribute': only custom attributes can be used on assemblies or modules\Doutorado\teste\AssemblyInfo.cpp(57) : error C2337: 'AssemblyKeyNameAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespaceForm1.cppd:\Doutorado\teste\Form1.h(6) : error C2871: 'System' : a namespace with this name does not existd:\Doutorado\teste\Form1.h(7) : error C2653: 'System' : is not a class or namespace named:\Doutorado\teste\Form1.h(7) : error C2871: 'ComponentModel' : a namespace with this name does not existd:\Doutorado\teste\Form1.h(8) : error C2653: 'System' : is not a class or namespace named:\Doutorado\teste\Form1.h(8) : error C2871: 'Collections' : a namespace
with this name does not existd:\Doutorado\teste\Form1.h(9) : error C2653: 'System' : is not a class or namespace named:\Doutorado\teste\Form1.h(9) : error C2871: 'Forms' : a namespace with this name does not existd:\Doutorado\teste\Form1.h(10) : error C2653: 'System' : is not a class or namespace named:\Doutorado\teste\Form1.h(10) : error C2871: 'Data' : a namespace with this name does not existd:\Doutorado\teste\Form1.h(11) : error C2653: 'System' : is not a class or namespace named:\Doutorado\teste\Form1.h(11) : error C2871: 'Drawing' : a namespace with this name does not existd:\Doutorado\teste\Form1.h(22) : error C2059: syntax error : 'public'd:\Doutorado\teste\Form1.h(22) : error C2059: syntax error : 'public'd:\Doutorado\teste\Form1.h(22) : error C2653: 'System' : is not a class or namespace named:\Doutorado\teste\Form1.h(23) : error C2143: syntax error : missing ';' before '{'d:\Doutorado\teste\Form1.h(23) : error C2447: '{' : missing function header (old-style formal
list?)d:\Doutorado\teste\Form1.h(57) : fatal error C1190: managed targeted code requires '#using ' and '/clr' optionGenerating Code...
Luis Ibanez <luis.ibanez at kitware.com> wrote:
Hi Marcelo,
For an example on how to use ITK with MFC you may want
to look at the application in
InsightApplications/ItkMFC.
What you do is to start the skeleton of your app using the
VisualStudio IDE, then create a CMakeList.txt file that uses
the files generated by VisualStudio. Then, from there, you
generate the Visual Studio project using CMake.
Regards,
Luis
-------------------------
Oliveira Marcelo wrote:
> Hi Luis and All !!!!
>
> Tanks a lot for your help !!!
>
> OK, i run my Hello !!!! But now i want to run this Hello inside a Form !!
>
> What i don't undestand yet is, How can i run my example with a Window
> Form Aplication (.NET) or using a GUI from VS .NET.
>
> For example: When i create a simple Window Form Aplication (.NET), VS
> generate the following files - Form1.cpp, stdafx.cpp,
> AssemblyInfo.cpp, Form1.h, resource.h, stdafx.h.
>
> I made my CMalist like this:
> ADD_LIBRARY( Form1.cpp stdafx.cpp )
> ADD_EXECUTABLE(formTest Form1.cpp stdafx.cpp )
> TARGET_LINK_LIBRARIES(formTest ITKNumerics ITKCommon ITKBasicFilters
> ITKIO ITKAlgorithms )
> And i put on Form1.cpp the #include "itkImage.h"
>
> CMake run ok, and create the bin directory with formTest.sln
>
> but when i try to build all to generete the EXE file inside the VS a
> lot of error happened !!!!
>
> What im doing wrong !!!!
>
> Tanks for your Hints and time !!!!
>
>
>
>
>
>
>
> */Luis Ibanez /* wrote:
>
>
> Hi Marcelo,
>
> You should use CMake for configuring your own Example.
>
> Please follow the instructions in the Tutorial sessions:
>
> http://www.itk.org/HTML/Tutorials.htm
>
> in particular in
>
> http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/img0.html
> http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/img27.html
>
> You should also read the first two chapters of the
> SoftwareGuide:
>
> http://www.itk.org/ItkSoftwareGuide.pdf
>
>
> That will save you a lot of time.
>
>
> Regards,
>
>
> Luis
>
>
> -------------------------
> Oliveira Marcelo wrote:
>
> > Hi user's !!!!
> >
> > ITK and VS .NET 2003 installed OK using CMAKE 2.0 on my Win XP.
> >
> > And now, i want to run a simple example:
> >
> > Then i create a Window Form Aplication (.NET) and in Form1.cpp i
> put < BR>> the #include "itkImage.h"
> >
> > I set the Includes and Library (TOOLS -> Option -> Projects -> VC++
> > Projects ) then when i build solution this message happen
> >
> > fatal error C1083: Cannot open include file:
> 'vnl/vnl_vector_ref.h': No
> > such file or directory d:\ITK\Code\Common\itkVector.h(21):
> >
> > What is the right way to execute VS 2003 .NET and ITK ????
> >
> >
> > tanks for advanced me
> >
>
>
>
> ------------------------------------------------------------------------
> Yahoo! Mail
>
> agora ainda melhor: 100MB, anti-spam e antivírus grátis!
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
---------------------------------
Yahoo! Mail agora ainda melhor: 100MB, anti-spam e antivírus grátis!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20040713/d54cd359/attachment.htm
More information about the Insight-users
mailing list