<div>Well, I didn't highlight the "ITKV3_COMPATIBILITY" option, that must be the main problem!</div><div>As to Visual Studio 2012, I <b>did rebuild</b> the ITK, with the compile "Visual Studio 11" chosed.</div><div>Here is the CMake Configuration Log:</div><div>//******************CMakeList.txt******************//</div><div>See in appendix file</div>//******************CMakeList.txt******************//<div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Bill Lorensen-2 [via ITK - Users]"<<a href="/user/SendEmail.jtp?type=node&node=30471&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>>;</div><div><b>发送时间:</b> 2013年1月4日(星期五) 晚上8:50</div><div><b>收件人:</b> "Czyhandsome"<<a href="/user/SendEmail.jtp?type=node&node=30471&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>>; <wbr></div><div></div><div><b>主题:</b> Re: AnalyzeImageIO can't work?</div></div><div><br></div>
        To use the deprecated classes you must turn ITKV3_COMPATIBILITY:BOOL=ON.
<br>But this was also true in itk 4.2.
<br><br>Did start with a new itk build when you switched to VS 2012?
<br><br>Can you show us your CMakeLists.txt file?
<br><br><br>On Fri, Jan 4, 2013 at 12:57 AM, Czyhandsome <<a href="/user/SendEmail.jtp?type=node&node=30470&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:
<div class="shrinkable-quote"><div class='shrinkable-quote'><br>> Hi, Bill. I've just updated ITk to 4.3, but to find that class AnalyzeImageIO
<br>> can't work properly.
<br>> Here is my code:
<br>>
<br>> //*************************Code*************************//
<br>> #include <itkImageFileReader.h>
<br>> #include <itkImageFileWriter.h>
<br>> #include <itkNiftiImageIO.h>
<br>>
<br>> typedef itk::Image<float, 3> ImageType;
<br>> typedef itk::ImageFileReader<ImageType> ReaderType;
<br>> typedef itk::ImageFileWriter<ImageType> WriterType;
<br>>
<br>> int main()
<br>> {
<br>> ReaderType::Pointer reader = ReaderType::New();
<br>> reader->SetFileName("C:\\Users\\dell\\Desktop\\Pictionary\\Basemap.img");
<br>>
<br>> itk::NiftiImageIO::Pointer imageIO = itk::NiftiImageIO::New();
<br>> reader->SetImageIO(imageIO);
<br>>
<br>> WriterType::Pointer writer = WriterType::New();
<br>> writer->SetInput(reader->GetOutput());
<br>>
<br>> writer->SetFileName("C:\\Users\\dell\\Desktop\\Pictionary\\NewBasemap.img");
<br>> writer->SetImageIO(imageIO);
<br>>
<br>> try
<br>> {
<br>> reader->Update();
<br>> writer->Update();
<br>> }
<br>> catch(itk::ExceptionObject &err)
<br>> {
<br>> std::cerr << err << std::endl;
<br>> }
<br>>
<br>> system("pause");
<br>> return 0;
<br>> }
<br>> //*************************Code*************************//
<br>>
<br>> This code worked very well last night, with visual studio 2008 and ITK-4.2.
<br>> But today, after changing to visual studio 2012 and ITK-4.3, this code can't
<br>> work, with the following error:
<br>>
<br>> //**************Error**************//
<br>> error LNK2019: 无法解析的外部符号 "protected: __thiscall
<br>> itk::AnalyzeImageIO::AnalyzeImageIO(void)"
<br>> (??0AnalyzeImageIO@itk@@IAE@XZ),该符号在函数 "public: static class
<br>> itk::SmartPointer<class itk::AnalyzeImageIO> __cdecl
<br>> itk::AnalyzeImageIO::New(void)"
<br>> (?New@AnalyzeImageIO@itk@@SA?AV?$SmartPointer@VAnalyzeImageIO@itk@@@2@XZ)
<br>> 中被引用 F:\Czy_Program\ITK_Task\ITK_Task\PNGReadWrite.obj ITK_Task
<br>>
<br>> //**************Error**************//
<br>> Why does this happen?
<br>>
<br>> FYI: The itkAnalyzeImageIO.h file is in folder
<br>> ".\ITK\InsightToolkit-4.3.1\Modules\Compatibility\Deprecated\include". Does
<br>> this means that I must check "compatibility" on when CMAKE, otherwise I
<br>> can't use those old-version classes?
<br>>
<br>> Looking forward to your reply.
<br>> Your sincerely
<br>> Cao Ziyu
<br>>
<br>>
<br>>
<br>>
<br>> --
<br>> View this message in context: <a href="http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30469.html" target="_top" rel="nofollow" link="external">http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30469.html</a><br>> Sent from the ITK - Users mailing list archive at Nabble.com.
<br>> _____________________________________
<br>> Powered by www.kitware.com
<br>>
<br>> Visit other Kitware open-source projects at
<br>> <a href="http://www.kitware.com/opensource/opensource.html" target="_top" rel="nofollow" link="external">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="_top" rel="nofollow" link="external">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="_top" rel="nofollow" link="external">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="_top" rel="nofollow" link="external">http://www.itk.org/mailman/listinfo/insight-users</a></div></div><br><br>--
<br>Unpaid intern in BillsBasement at noware dot com
<br>_____________________________________
<br>Powered by www.kitware.com
<br><br>Visit other Kitware open-source projects at
<br><a href="http://www.kitware.com/opensource/opensource.html" target="_top" rel="nofollow" link="external">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="_top" rel="nofollow" link="external">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="_top" rel="nofollow" link="external">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="_top" rel="nofollow" link="external">http://www.itk.org/mailman/listinfo/insight-users</a><br>
        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1" color="#cccccc">
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30469p30470.html" target="_top" rel="nofollow" link="external">http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30469p30470.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from AnalyzeImageIO can't work?, <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://itk-users.7.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>
        </div></div><div class="small"><br/><img src="/images/icon_attachment.gif" > <strong>CMakeLists.txt</strong> (34K) <a href="http://itk-users.7.n7.nabble.com/attachment/30471/0/CMakeLists.txt" target="_top" rel="nofollow" link="external">Download Attachment</a></div>
        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30471.html">回复: AnalyzeImageIO can't work?</a><br/>
Sent from the <a href="http://itk-users.7.n7.nabble.com/">ITK - Users mailing list archive</a> at Nabble.com.<br/>