[Insight-users] Itk develpoer example building error , please help
Jon Haitz Legarreta
jhlegarreta at vicomtech.org
Fri Mar 14 05:40:11 EDT 2014
Dear Alaa,
have you built correctly ITK prior to trying to build the example? Are you
liniking to the ITK binaires correctly (i.e. did you point to the ITK
binaries in your CMake)?
If not or if you didn't already, configuring and building ITK [1] and
building your first program [2] may be of help. ITK SW guide's [3] second
chapter (installation) may be worth reading as well.
JON HAITZ
[1] http://www.itk.org/Wiki/ITK/Getting_Started/Build
[2] http://www.itk.org/Wiki/ITK/HelloInsight
[3] http://www.itk.org/ItkSoftwareGuide.pdf
On 14 March 2014 10:16, alaamegawer <alaamegawer at yahoo.com> wrote:
> Hi All
>
> I'm trying to build itk wiki developer example but all my trials failed and
> i don't know to build and use it.
>
> my files are
> //ImageSource.cxx
>
> #include "itkImage.h"
> #include "itkImageFileWriter.h"
>
> #include "ImageSource.h"
>
> int main(int, char*[])
> {
> // Setup types
> typedef itk::Image<unsigned char, 2> ImageType;
> typedef itk::ImageFilter<ImageType> FilterType;
>
> // Create and the filter
> FilterType::Pointer filter = FilterType::New();
> filter->Update();
>
> typedef itk::ImageFileWriter< ImageType > WriterType;
> WriterType::Pointer writer = WriterType::New();
> writer->SetFileName("Test.jpg");
> writer->SetInput(filter->GetOutput());
> writer->Update();
>
> return EXIT_SUCCESS;
> }
>
> //ImageSource.h
>
> #ifndef __itkImageFilter_h
> #define __itkImageFilter_h
>
> #include "itkImageToImageFilter.h"
>
> #include <set>
>
> namespace itk
> {
> template< class TImage>
> class ImageFilter:public ImageToImageFilter< TImage, TImage >
> {
> public:
>
> /** Standard class typedefs. */
> typedef ImageFilter Self;
> typedef ImageToImageFilter< TImage, TImage > Superclass;
> typedef SmartPointer< Self > Pointer;
>
> /** Method for creation through the object factory. */
> itkNewMacro(Self);
>
> /** Run-time type information (and related methods). */
> itkTypeMacro(ImageFilter, ImageToImageFilter);
>
> protected:
> ImageFilter(){}
> ~ImageFilter(){}
>
> /** Does the real work. */
> virtual void GenerateData();
>
> private:
> ImageFilter(const Self &); //purposely not implemented
> void operator=(const Self &); //purposely not implemented
>
> };
> } //namespace ITK
>
>
> #ifndef ITK_MANUAL_INSTANTIATION
> #include "ImageSource.h"
> #endif
>
>
> #endif // __itkImageFilter_h
>
> // ImageSource.txx
>
> #ifndef __itkImageFilter_txx
> #define __itkImageFilter_txx
>
> #include "ImageSource.h"
> #include "itkObjectFactory.h"
> #include "itkImageRegionIterator.h"
> #include "itkImageRegionConstIterator.h"
>
> namespace itk
> {
>
> template< class TImage>
> void ImageFilter< TImage>
> ::GenerateData()
> {
> double a = 2.1;
> itkExceptionMacro ("Here is a variable: " << a << " and then more
> text.");
> }
>
> }// end namespace
>
>
> #endif
>
>
> after building it i have this error
>
> Error 3 error LNK2001: unresolved external symbol "protected:
> virtual void
> __thiscall itk::ImageFilter<class itk::Image<unsigned char,2>
> >::GenerateData(void)"
> (?GenerateData@?$ImageFilter at V?$Image at E$01 at itk@@@itk@@MAEXXZ)
> C:\Programs\Itk\examples\ImageSource\bin\ImageSource.obj ImageSource
>
>
> thanks in advance
>
> Alaa
>
>
>
>
>
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/Itk-develpoer-example-building-error-please-help-tp7585187.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140314/b79bbb67/attachment.html>
More information about the Insight-users
mailing list