<div dir="ltr"><div><div>Dear Alaa,<br></div>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)?<br><br>
</div><div>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.<br></div>
<div><br></div>JON HAITZ<br><br>[1] <a href="http://www.itk.org/Wiki/ITK/Getting_Started/Build">http://www.itk.org/Wiki/ITK/Getting_Started/Build</a><br>[2] <a href="http://www.itk.org/Wiki/ITK/HelloInsight">http://www.itk.org/Wiki/ITK/HelloInsight</a><br>
[3] <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br><br><div><div><div><div><div class="gmail_extra"><div class="gmail_quote"><br>On 14 March 2014 10:16, alaamegawer <span dir="ltr"><<a href="mailto:alaamegawer@yahoo.com" target="_blank">alaamegawer@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi All<br>
<br>
I'm trying to build itk wiki developer example but all my trials failed and<br>
i don't know to build and use it.<br>
<br>
my files are<br>
//ImageSource.cxx<br>
<br>
#include "itkImage.h"<br>
#include "itkImageFileWriter.h"<br>
<br>
#include "ImageSource.h"<br>
<br>
int main(int, char*[])<br>
{<br>
  // Setup types<br>
  typedef itk::Image<unsigned char, 2>   ImageType;<br>
  typedef itk::ImageFilter<ImageType>  FilterType;<br>
<br>
  // Create and the filter<br>
  FilterType::Pointer filter = FilterType::New();<br>
  filter->Update();<br>
<br>
  typedef  itk::ImageFileWriter< ImageType  > WriterType;<br>
  WriterType::Pointer writer = WriterType::New();<br>
  writer->SetFileName("Test.jpg");<br>
  writer->SetInput(filter->GetOutput());<br>
  writer->Update();<br>
<br>
  return EXIT_SUCCESS;<br>
}<br>
<br>
//ImageSource.h<br>
<br>
#ifndef __itkImageFilter_h<br>
#define __itkImageFilter_h<br>
<br>
#include "itkImageToImageFilter.h"<br>
<br>
#include <set><br>
<br>
namespace itk<br>
{<br>
template< class TImage><br>
class ImageFilter:public ImageToImageFilter< TImage, TImage ><br>
{<br>
public:<br>
<br>
  /** Standard class typedefs. */<br>
  typedef ImageFilter             Self;<br>
  typedef ImageToImageFilter< TImage, TImage > Superclass;<br>
  typedef SmartPointer< Self >        Pointer;<br>
<br>
  /** Method for creation through the object factory. */<br>
  itkNewMacro(Self);<br>
<br>
  /** Run-time type information (and related methods). */<br>
  itkTypeMacro(ImageFilter, ImageToImageFilter);<br>
<br>
protected:<br>
  ImageFilter(){}<br>
  ~ImageFilter(){}<br>
<br>
  /** Does the real work. */<br>
  virtual void GenerateData();<br>
<br>
private:<br>
  ImageFilter(const Self &); //purposely not implemented<br>
  void operator=(const Self &);  //purposely not implemented<br>
<br>
};<br>
} //namespace ITK<br>
<br>
<br>
#ifndef ITK_MANUAL_INSTANTIATION<br>
#include "ImageSource.h"<br>
#endif<br>
<br>
<br>
#endif // __itkImageFilter_h<br>
<br>
// ImageSource.txx<br>
<br>
#ifndef __itkImageFilter_txx<br>
#define __itkImageFilter_txx<br>
<br>
#include "ImageSource.h"<br>
#include "itkObjectFactory.h"<br>
#include "itkImageRegionIterator.h"<br>
#include "itkImageRegionConstIterator.h"<br>
<br>
namespace itk<br>
{<br>
<br>
template< class TImage><br>
void ImageFilter< TImage><br>
::GenerateData()<br>
{<br>
  double a = 2.1;<br>
  itkExceptionMacro ("Here is a variable: " << a << " and then more text.");<br>
}<br>
<br>
}// end namespace<br>
<br>
<br>
#endif<br>
<br>
<br>
after building it i have this error<br>
<br>
Error   3       error LNK2001: unresolved external symbol "protected: virtual void<br>
__thiscall itk::ImageFilter<class itk::Image<unsigned char,2><br>
>::GenerateData(void)"<br>
(?GenerateData@?$ImageFilter@V?$Image@E$01@itk@@@itk@@MAEXXZ)<br>
C:\Programs\Itk\examples\ImageSource\bin\ImageSource.obj        ImageSource<br>
<br>
<br>
thanks in advance<br>
<br>
Alaa<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Itk-develpoer-example-building-error-please-help-tp7585187.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Itk-develpoer-example-building-error-please-help-tp7585187.html</a><br>

Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div></div></div></div></div></div>