Dear Fari,<br>concerning the linking error, it looks like your project does not know where your ITK libraries are located. Make sure that your CMakeLists.txt contains the appropriate reference to the location of the ITK libraries, or either you can setup the linking properties in MS Visual Studio.<br>
<br>Concerning the names of the IO images, you should include input arguments in you main method so that you can enter some names for your files and your program can have access to these variables:<br><br>This may be of help:<br>
<br>int main( int argc, char* argv[] )<br>{<br><br>// Typedefs<br>


typedef itk::Image&lt; PixelType, Dimension &gt;      InputImageType ; // 
Choose the PixelType and Dimension that best fit your problem<br>typedef itk::Image&lt; PixelType, Dimension &gt;      OutputImageType ; // 
Choose the PixelType and Dimension that best fit your problem<br>


<br>typedef itk::ImageFileReader&lt; InputImageType &gt;                 ReaderType;<br>


typedef itk::ImageFileWriter&lt; OutputImageType &gt;             WriterType;<br><br><br>


// Objects<br>


ReaderType::Pointer                                     reader = ReaderType::New();<br>


WriterType::Pointer                                       writer = WriterType::New();<br><br>// Other things you need<br><br>reader-&gt;SetFileName( argv[1] );<br>writer-&gt;SetFileName( argv[2] );<br><br>// Your process<br>

<br>return EXIT_SUCCESS;<br><br>}<br><br>You can enter the names of the input arguments both when executing the command line or when executing in MS Visual Studio as the input parameters for execution in your project properties.<br>
<br>Best regards,<br>JON HAITZ<br><br><br><br><div style="margin: 0pt;" name="sig_d41d8cd98f"></div><div class="gmail_quote">On 2 November 2011 15:24, faba <span dir="ltr">&lt;<a href="mailto:faba_ir@yahoo.com">faba_ir@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear Friends:<br>
I am trying to generate a simple program that read a jpep image and write it<br>
with another name. Cmake can configure and generate the project with no<br>
problem, but when I want to build it in MS Visual C++ 2008, it gives me lots<br>
of compilation errors. My questions are that:<br>
1- what is the cause of errors?<br>
2- What should I do, if I want to declare the name of input image<br>
(cameraman_old.jpg) and output images (cameraman_new.jpg) as two inputs of<br>
the program (and not to mentioned inside the program)?<br>
Attached you can see my simple program and compilations errors.<br>
<br>
Your helps are really appreciated<br>
Fari<br>
<br>
<br>
<br>
-- <a href="http://itk-insight-users.2283740.n2.nabble.com/file/n6955425/2.jpg" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/file/n6955425/2.jpg</a><br>
-- <a href="http://itk-insight-users.2283740.n2.nabble.com/file/n6955425/1.jpg" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/file/n6955425/1.jpg</a><br>
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Read-Write-Program-tp6955425p6955425.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Read-Write-Program-tp6955425p6955425.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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>