<font size="2"><font face="verdana,sans-serif">Have you tested this example? What are the findings?<br></font></font><br><div class="gmail_quote">2011/11/15 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">Checking whether it works with that revision will take some time, so I cannot do it today. I can do it tomorrow if the below info doesn't get it resolved.<br>
<br>Here is the mwe. Error in Release, not in Debug or RelWithDebInfo:<br>
<br><span style="font-family:courier new,monospace">#include "itkTriangleCell.h"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">#include "itkMesh.h"</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">typedef itk::Mesh<float,3> MeshType;</span><div class="im"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">typedef MeshType::CellType CellType;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">typedef CellType::CellAutoPointer CellAutoPointer;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">typedef itk::TriangleCell< CellType > TriangleType;</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"></div><span style="font-family:courier new,monospace">void main()</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">{</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> CellAutoPointer tr;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> tr.TakeOwnership(new TriangleType);</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> //or just this: TriangleType *tt=new TriangleType;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">}</span><br>
</font></font><div><div></div><div class="h5"><br><div class="gmail_quote">2011/11/15 Arnaud Gelas <span dir="ltr"><<a href="mailto:arnaud_gelas@hms.harvard.edu" target="_blank">arnaud_gelas@hms.harvard.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Dženan,<br>
<br>
Can you post a complete and minimal main where we could reproduce
the error, please?<br>
<br>
Can you also try <br>
<br>
$ git revert d7b64276cd2f15d336c50df76b275e7a67b80c57<br>
<br>
please?<br>
<br>
thanks,<br><font color="#888888">
Arnaud</font><div><div></div><div><br>
<br>
On 11/15/2011 10:12 AM, Dženan Zukić wrote:
<blockquote type="cite"><font size="2"><font face="verdana,sans-serif">No, the
error remains. By the way, declaration "class ITKCommon_EXPORT
TriangleCellTopology" is on line 36 in the source code I am
looking at.<br>
</font></font><br>
<div class="gmail_quote">
2011/11/15 Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
<div>
<div>> It compiles correctly in release mode
when I remove the "virtual" 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 `public:<br>
> __cdecl itk::TriangleCell<class
itk::CellInterface<float,class<br>
> itk::CellTraitsInfo<3,float,float,unsigned
__int64,unsigned __int64,unsigned<br>
> __int64,class itk::Point<float,3>,class
itk::VectorContainer<unsigned<br>
> __int64,class itk::Point<float,3> >,class
std::set<unsigned __int64,struct<br>
> std::less<unsigned __int64>,class
std::allocator<unsigned __int64> > > ><br>
>>::TriangleCell<class
itk::CellInterface<float,class<br>
> itk::CellTraitsInfo<3,float,float,unsigned
__int64,unsigned __int64,unsigned<br>
> __int64,class itk::Point<float,3>,class
itk::VectorContainer<unsigned<br>
> __int64,class itk::Point<float,3> >,class
std::set<unsigned __int64,struct<br>
> std::less<unsigned __int64>,class
std::allocator<unsigned __int64> > > ><br>
>>(void)'::`1'::dtor$1"<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 <<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 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>
>> 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: "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 (one<br>
>>>> revision after RC2). Now my project no
longer compiles in release mode<br>
>>>> (debug and relwithdebinfo compile fine).
The error is given below. 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 `public:<br>
>>>> __cdecl itk::TriangleCell<class
itk::CellInterface<float,class<br>
>>>>
itk::CellTraitsInfo<3,float,float,unsigned
__int64,unsigned __int64,unsigned<br>
>>>> __int64,class
itk::Point<float,3>,class
itk::VectorContainer<unsigned<br>
>>>> __int64,class itk::Point<float,3>
>,class std::set<unsigned __int64,struct<br>
>>>> std::less<unsigned __int64>,class
std::allocator<unsigned __int64> > > ><br>
>>>> >::TriangleCell<class
itk::CellInterface<float,class<br>
>>>>
itk::CellTraitsInfo<3,float,float,unsigned
__int64,unsigned __int64,unsigned<br>
>>>> __int64,class
itk::Point<float,3>,class
itk::VectorContainer<unsigned<br>
>>>> __int64,class itk::Point<float,3>
>,class std::set<unsigned __int64,struct<br>
>>>> std::less<unsigned __int64>,class
std::allocator<unsigned __int64> > > ><br>
>>>> >(void)'::`1'::dtor$1"<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>
</div>
</div>
> _____________________________________<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>
</blockquote>
</div>
<br>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>