[ITK Community] [Insight-users] Itk develpoer example building error , please help

alaamegawer alaamegawer at yahoo.com
Fri Mar 14 05:16:19 EDT 2014


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



More information about the Community mailing list