<font size="2"><font face="verdana,sans-serif">Clean and rebuild solved the problem.<br><br>But a general question then: do I need to rebuild everything each time I update the source code? Why isn't Visual Studio taking a safer approach (rebuild more than it currently does) when deciding what needs to be rebuilt after source code change?<br>
<br>Thanks for help,<br>Dženan<br></font></font><br><div class="gmail_quote">2011/11/17 Dženan Zukić <span dir="ltr"><<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font size="2"><font face="verdana,sans-serif">Of course I have built all 3 build types, both ITK and the example.<br><br>I have started with a clean build tree when I switched from ITK3 to ITK4. However I have updated ITK4 source several times, and usually just pressed build, not clean and rebuild, in order to save time. I will now try cleaning the Release build of ITK and rebuilding it.<br>
</font></font><div><div></div><div class="h5"><br><div class="gmail_quote">On Wed, Nov 16, 2011 at 20:38, Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Bill has good points. It would be best to try again from a clean build tree.<br>
<br>
Matt<br>
<br>
2011/11/16 Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>>:<br>
<div><div></div><div>> Also, you must build your example with the same build type (Release,<br>
> Debug or RelWithDebInfo) that you used when you build ITK.<br>
><br>
> 2011/11/16 Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>>:<br>
>> When you updated to itkv4 did you start with a clean (empty) build<br>
>> tree? Likewise for your simple example.<br>
>><br>
>> Do you have more than one version of Visual Studio on your system?<br>
>><br>
>> Do you have more than one ITK build on your system?<br>
>><br>
>> Can you share the CMakeLists.txt file for your simple example?<br>
>><br>
>> 2011/11/16 Dženan Zukić <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>>:<br>
>>> Have you tested this example? What are the findings?<br>
>>><br>
>>> 2011/11/15 Dženan Zukić <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>><br>
>>>><br>
>>>> Checking whether it works with that revision will take some time, so I<br>
>>>> cannot do it today. I can do it tomorrow if the below info doesn't get it<br>
>>>> resolved.<br>
>>>><br>
>>>> Here is the mwe. Error in Release, not in Debug or RelWithDebInfo:<br>
>>>><br>
>>>> #include "itkTriangleCell.h"<br>
>>>> #include "itkMesh.h"<br>
>>>><br>
>>>> typedef itk::Mesh<float,3> MeshType;<br>
>>>> typedef MeshType::CellType CellType;<br>
>>>> typedef CellType::CellAutoPointer CellAutoPointer;<br>
>>>> typedef itk::TriangleCell< CellType > TriangleType;<br>
>>>><br>
>>>> void main()<br>
>>>> {<br>
>>>> CellAutoPointer tr;<br>
>>>> tr.TakeOwnership(new TriangleType);<br>
>>>> //or just this: TriangleType *tt=new TriangleType;<br>
>>>> }<br>
>>>><br>
>>>> 2011/11/15 Arnaud Gelas <<a href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>><br>
>>>>><br>
>>>>> Dženan,<br>
>>>>><br>
>>>>> Can you post a complete and minimal main where we could reproduce the<br>
>>>>> error, please?<br>
>>>>><br>
>>>>> Can you also try<br>
>>>>><br>
>>>>> $ git revert d7b64276cd2f15d336c50df76b275e7a67b80c57<br>
>>>>><br>
>>>>> please?<br>
>>>>><br>
>>>>> thanks,<br>
>>>>> Arnaud<br>
>>>>><br>
>>>>> On 11/15/2011 10:12 AM, Dženan Zukić wrote:<br>
>>>>><br>
>>>>> No, the error remains. By the way, declaration "class ITKCommon_EXPORT<br>
>>>>> TriangleCellTopology" is on line 36 in the source code I am looking at.<br>
>>>>><br>
>>>>> 2011/11/15 Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>><br>
>>>>>><br>
>>>>>> Hi Dženan,<br>
>>>>>><br>
>>>>>> Does it work if you re-add the virtual keyword, then change<br>
>>>>>> 'ITK_EXPORT' on line 45 to 'ITKCommon_EXPORT'?<br>
>>>>>><br>
>>>>>> Thanks,<br>
>>>>>> Matt<br>
>>>>>><br>
>>>>>> 2011/11/15 Dženan Zukić <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>>:<br>
>>>>>> > It compiles correctly in release mode when I remove the "virtual"<br>
>>>>>> > keyword.<br>
>>>>>> > However with this change there is an error in debug and relwithdebinfo<br>
>>>>>> > modes:<br>
>>>>>> ><br>
>>>>>> > error LNK2019: unresolved external symbol "public: __cdecl<br>
>>>>>> > itk::TriangleCellTopology::~TriangleCellTopology(void)"<br>
>>>>>> > (??1TriangleCellTopology@itk@@QEAA@XZ) referenced in function "int<br>
>>>>>> > `public:<br>
>>>>>> > __cdecl itk::TriangleCell<class itk::CellInterface<float,class<br>
>>>>>> > itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned<br>
>>>>>> > __int64,unsigned<br>
>>>>>> > __int64,class itk::Point<float,3>,class itk::VectorContainer<unsigned<br>
>>>>>> > __int64,class itk::Point<float,3> >,class std::set<unsigned<br>
>>>>>> > __int64,struct<br>
>>>>>> > std::less<unsigned __int64>,class std::allocator<unsigned __int64> > ><br>
>>>>>> > ><br>
>>>>>> >>::TriangleCell<class itk::CellInterface<float,class<br>
>>>>>> > itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned<br>
>>>>>> > __int64,unsigned<br>
>>>>>> > __int64,class itk::Point<float,3>,class itk::VectorContainer<unsigned<br>
>>>>>> > __int64,class itk::Point<float,3> >,class std::set<unsigned<br>
>>>>>> > __int64,struct<br>
>>>>>> > std::less<unsigned __int64>,class std::allocator<unsigned __int64> > ><br>
>>>>>> > ><br>
>>>>>> >>(void)'::`1'::dtor$1"<br>
>>>>>> ><br>
>>>>>> > (?dtor$1@?0???0?$TriangleCell@V?$CellInterface@MV?$CellTraitsInfo@$02MM_K_K_KV?$Point@M$02@itk@@V?$VectorContainer@_KV?$Point@M$02@itk@@@2@V?$set@_KU?$less@_K@std@@V?$allocator@_K@2@@std@@@itk@@@itk@@@itk@@QEAA@XZ@4HA)<br>
>>>>>> ><br>
>>>>>> > On Tue, Nov 15, 2011 at 15:00, Arnaud Gelas<br>
>>>>>> > <<a href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>><br>
>>>>>> > wrote:<br>
>>>>>> >><br>
>>>>>> >> I guess the problem has been introduced<br>
>>>>>> >> in d7b64276cd2f15d336c50df76b275e7a67b80c57, the destructor became<br>
>>>>>> >> virtual<br>
>>>>>> >> (?). Apart from that I don't see any recent changes on these files...<br>
>>>>>> >> Can you try removing the virtual keyword ?<br>
>>>>>> >> On Nov 15, 2011, at 8:44 AM, Arnaud Gelas wrote:<br>
>>>>>> >><br>
>>>>>> >> My bad, it was already implemented in the corresponding cxx file :-/<br>
>>>>>> >> ...<br>
>>>>>> >> Which version of Microsoft Visual is it?<br>
>>>>>> >><br>
>>>>>> >> On Nov 15, 2011, at 8:24 AM, Dženan Zukić wrote:<br>
>>>>>> >><br>
>>>>>> >> I tried. It gives a different error then:<br>
>>>>>> >><br>
>>>>>> >> 2>ITKCommon-4.0.lib(itkTriangleCellTopology.obj) : error LNK2005:<br>
>>>>>> >> "public:<br>
>>>>>> >> __cdecl itk::TriangleCellTopology::TriangleCellTopology(void)"<br>
>>>>>> >> (??0TriangleCellTopology@itk@@QEAA@XZ) already defined in qeUtil.obj<br>
>>>>>> >> 2> Creating library D:/Repo/Spine/Release/Spine.lib and object<br>
>>>>>> >> D:/Repo/Spine/Release/Spine.exp<br>
>>>>>> >> 2>D:\Repo\Spine\Release\Spine.exe : fatal error LNK1169: one or more<br>
>>>>>> >> multiply defined symbols found<br>
>>>>>> >><br>
>>>>>> >> 2011/11/15 Dženan Zukić <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>><br>
>>>>>> >>><br>
>>>>>> >>> You mean in the source code of TriangleCellTopology?<br>
>>>>>> >>><br>
>>>>>> >>> 2011/11/15 Arnaud Gelas <<a href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>><br>
>>>>>> >>>><br>
>>>>>> >>>> Hi Dzenan,<br>
>>>>>> >>>> Can you try changing as follows, please?<br>
>>>>>> >>>> 39 TriangleCellTopology();<br>
>>>>>> >>>> 40 virtual ~TriangleCellTopology();<br>
>>>>>> >>>> by<br>
>>>>>> >>>> 39 TriangleCellTopology() {}<br>
>>>>>> >>>> 40 virtual ~TriangleCellTopology() {}<br>
>>>>>> >>>> My 2 cts,<br>
>>>>>> >>>> Arnaud<br>
>>>>>> >>>> On Nov 15, 2011, at 6:45 AM, Dženan Zukić wrote:<br>
>>>>>> >>>><br>
>>>>>> >>>> Hi all,<br>
>>>>>> >>>><br>
>>>>>> >>>> I updated my ITK to commit dd21441682b47f9e553259d2c2948c71c806bcdd<br>
>>>>>> >>>> (one<br>
>>>>>> >>>> revision after RC2). Now my project no longer compiles in release<br>
>>>>>> >>>> mode<br>
>>>>>> >>>> (debug and relwithdebinfo compile fine). The error is given below.<br>
>>>>>> >>>> The code<br>
>>>>>> >>>> used is:<br>
>>>>>> >>>><br>
>>>>>> >>>> #include "itkTriangleCell.h"<br>
>>>>>> >>>> //other includes<br>
>>>>>> >>>><br>
>>>>>> >>>> typedef MeshType::CellType CellType;<br>
>>>>>> >>>> typedef CellType::CellAutoPointer CellAutoPointer;<br>
>>>>>> >>>> typedef itk::TriangleCell< CellType > TriangleType;<br>
>>>>>> >>>><br>
>>>>>> >>>> //later I use it:<br>
>>>>>> >>>> CellAutoPointer tr;<br>
>>>>>> >>>> tr.TakeOwnership(new TriangleType);<br>
>>>>>> >>>><br>
>>>>>> >>>> Any hints about how to fix it?<br>
>>>>>> >>>><br>
>>>>>> >>>> Regards,<br>
>>>>>> >>>> Dženan<br>
>>>>>> >>>><br>
>>>>>> >>>> error LNK2019: unresolved external symbol "public: virtual __cdecl<br>
>>>>>> >>>> itk::TriangleCellTopology::~TriangleCellTopology(void)"<br>
>>>>>> >>>> (??1TriangleCellTopology@itk@@UEAA@XZ) referenced in function "int<br>
>>>>>> >>>> `public:<br>
>>>>>> >>>> __cdecl itk::TriangleCell<class itk::CellInterface<float,class<br>
>>>>>> >>>> itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned<br>
>>>>>> >>>> __int64,unsigned<br>
>>>>>> >>>> __int64,class itk::Point<float,3>,class<br>
>>>>>> >>>> itk::VectorContainer<unsigned<br>
>>>>>> >>>> __int64,class itk::Point<float,3> >,class std::set<unsigned<br>
>>>>>> >>>> __int64,struct<br>
>>>>>> >>>> std::less<unsigned __int64>,class std::allocator<unsigned __int64><br>
>>>>>> >>>> > > ><br>
>>>>>> >>>> >::TriangleCell<class itk::CellInterface<float,class<br>
>>>>>> >>>> itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned<br>
>>>>>> >>>> __int64,unsigned<br>
>>>>>> >>>> __int64,class itk::Point<float,3>,class<br>
>>>>>> >>>> itk::VectorContainer<unsigned<br>
>>>>>> >>>> __int64,class itk::Point<float,3> >,class std::set<unsigned<br>
>>>>>> >>>> __int64,struct<br>
>>>>>> >>>> std::less<unsigned __int64>,class std::allocator<unsigned __int64><br>
>>>>>> >>>> > > ><br>
>>>>>> >>>> >(void)'::`1'::dtor$1"<br>
>>>>>> >>>><br>
>>>>>> >>>> (?dtor$1@?0???0?$TriangleCell@V?$CellInterface@MV?$CellTraitsInfo@$02MM_K_K_KV?$Point@M$02@itk@@V?$VectorContainer@_KV?$Point@M$02@itk@@@2@V?$set@_KU?$less@_K@std@@V?$allocator@_K@2@@std@@@itk@@@itk@@@itk@@QEAA@XZ@4HA)<br>
>>>>>> >>>><br>
>>>>>> >>>><br>
>>>>>> >>>> <ATT00001.txt><br>
>>>>>> >>><br>
>>>>>> >><br>
>>>>>> >><br>
>>>>>> >> <ATT00001.txt><br>
>>>>>> ><br>
>>>>>> ><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>
>>>>>> ><br>
>>>>>> ><br>
>>>>><br>
>>>>><br>
>>>><br>
>>><br>
>>><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>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Unpaid intern in BillsBasement at noware dot com<br>
>><br>
><br>
><br>
><br>
> --<br>
> Unpaid intern in BillsBasement at noware dot 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>
><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>