[Insight-users] Link error in Release: TriangleCellTopology
Bill Lorensen
bill.lorensen at gmail.com
Wed Nov 16 14:18:08 EST 2011
When you updated to itkv4 did you start with a clean (empty) build
tree? Likewise for your simple example.
Do you have more than one version of Visual Studio on your system?
Do you have more than one ITK build on your system?
Can you share the CMakeLists.txt file for your simple example?
2011/11/16 Dženan Zukić <dzenanz at gmail.com>:
> Have you tested this example? What are the findings?
>
> 2011/11/15 Dženan Zukić <dzenanz at gmail.com>
>>
>> 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.
>>
>> Here is the mwe. Error in Release, not in Debug or RelWithDebInfo:
>>
>> #include "itkTriangleCell.h"
>> #include "itkMesh.h"
>>
>> typedef itk::Mesh<float,3> MeshType;
>> typedef MeshType::CellType CellType;
>> typedef CellType::CellAutoPointer CellAutoPointer;
>> typedef itk::TriangleCell< CellType > TriangleType;
>>
>> void main()
>> {
>> CellAutoPointer tr;
>> tr.TakeOwnership(new TriangleType);
>> //or just this: TriangleType *tt=new TriangleType;
>> }
>>
>> 2011/11/15 Arnaud Gelas <arnaud_gelas at hms.harvard.edu>
>>>
>>> Dženan,
>>>
>>> Can you post a complete and minimal main where we could reproduce the
>>> error, please?
>>>
>>> Can you also try
>>>
>>> $ git revert d7b64276cd2f15d336c50df76b275e7a67b80c57
>>>
>>> please?
>>>
>>> thanks,
>>> Arnaud
>>>
>>> On 11/15/2011 10:12 AM, Dženan Zukić wrote:
>>>
>>> No, the error remains. By the way, declaration "class ITKCommon_EXPORT
>>> TriangleCellTopology" is on line 36 in the source code I am looking at.
>>>
>>> 2011/11/15 Matt McCormick <matt.mccormick at kitware.com>
>>>>
>>>> Hi Dženan,
>>>>
>>>> Does it work if you re-add the virtual keyword, then change
>>>> 'ITK_EXPORT' on line 45 to 'ITKCommon_EXPORT'?
>>>>
>>>> Thanks,
>>>> Matt
>>>>
>>>> 2011/11/15 Dženan Zukić <dzenanz at gmail.com>:
>>>> > It compiles correctly in release mode when I remove the "virtual"
>>>> > keyword.
>>>> > However with this change there is an error in debug and relwithdebinfo
>>>> > modes:
>>>> >
>>>> > error LNK2019: unresolved external symbol "public: __cdecl
>>>> > itk::TriangleCellTopology::~TriangleCellTopology(void)"
>>>> > (??1TriangleCellTopology at itk@@QEAA at XZ) referenced in function "int
>>>> > `public:
>>>> > __cdecl itk::TriangleCell<class itk::CellInterface<float,class
>>>> > itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned
>>>> > __int64,unsigned
>>>> > __int64,class itk::Point<float,3>,class itk::VectorContainer<unsigned
>>>> > __int64,class itk::Point<float,3> >,class std::set<unsigned
>>>> > __int64,struct
>>>> > std::less<unsigned __int64>,class std::allocator<unsigned __int64> > >
>>>> > >
>>>> >>::TriangleCell<class itk::CellInterface<float,class
>>>> > itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned
>>>> > __int64,unsigned
>>>> > __int64,class itk::Point<float,3>,class itk::VectorContainer<unsigned
>>>> > __int64,class itk::Point<float,3> >,class std::set<unsigned
>>>> > __int64,struct
>>>> > std::less<unsigned __int64>,class std::allocator<unsigned __int64> > >
>>>> > >
>>>> >>(void)'::`1'::dtor$1"
>>>> >
>>>> > (?dtor$1@?0???0?$TriangleCell at V?$CellInterface at MV?$CellTraitsInfo@$02MM_K_K_KV?$Point at M$02 at itk@@V?$VectorContainer at _KV?$Point at M$02 at itk@@@2 at V?$set at _KU?$less at _K@std@@V?$allocator at _K@2@@std@@@itk@@@itk@@@itk@@QEAA at XZ@4HA)
>>>> >
>>>> > On Tue, Nov 15, 2011 at 15:00, Arnaud Gelas
>>>> > <arnaud_gelas at hms.harvard.edu>
>>>> > wrote:
>>>> >>
>>>> >> I guess the problem has been introduced
>>>> >> in d7b64276cd2f15d336c50df76b275e7a67b80c57, the destructor became
>>>> >> virtual
>>>> >> (?). Apart from that I don't see any recent changes on these files...
>>>> >> Can you try removing the virtual keyword ?
>>>> >> On Nov 15, 2011, at 8:44 AM, Arnaud Gelas wrote:
>>>> >>
>>>> >> My bad, it was already implemented in the corresponding cxx file :-/
>>>> >> ...
>>>> >> Which version of Microsoft Visual is it?
>>>> >>
>>>> >> On Nov 15, 2011, at 8:24 AM, Dženan Zukić wrote:
>>>> >>
>>>> >> I tried. It gives a different error then:
>>>> >>
>>>> >> 2>ITKCommon-4.0.lib(itkTriangleCellTopology.obj) : error LNK2005:
>>>> >> "public:
>>>> >> __cdecl itk::TriangleCellTopology::TriangleCellTopology(void)"
>>>> >> (??0TriangleCellTopology at itk@@QEAA at XZ) already defined in qeUtil.obj
>>>> >> 2> Creating library D:/Repo/Spine/Release/Spine.lib and object
>>>> >> D:/Repo/Spine/Release/Spine.exp
>>>> >> 2>D:\Repo\Spine\Release\Spine.exe : fatal error LNK1169: one or more
>>>> >> multiply defined symbols found
>>>> >>
>>>> >> 2011/11/15 Dženan Zukić <dzenanz at gmail.com>
>>>> >>>
>>>> >>> You mean in the source code of TriangleCellTopology?
>>>> >>>
>>>> >>> 2011/11/15 Arnaud Gelas <arnaud_gelas at hms.harvard.edu>
>>>> >>>>
>>>> >>>> Hi Dzenan,
>>>> >>>> Can you try changing as follows, please?
>>>> >>>> 39 TriangleCellTopology();
>>>> >>>> 40 virtual ~TriangleCellTopology();
>>>> >>>> by
>>>> >>>> 39 TriangleCellTopology() {}
>>>> >>>> 40 virtual ~TriangleCellTopology() {}
>>>> >>>> My 2 cts,
>>>> >>>> Arnaud
>>>> >>>> On Nov 15, 2011, at 6:45 AM, Dženan Zukić wrote:
>>>> >>>>
>>>> >>>> Hi all,
>>>> >>>>
>>>> >>>> I updated my ITK to commit dd21441682b47f9e553259d2c2948c71c806bcdd
>>>> >>>> (one
>>>> >>>> revision after RC2). Now my project no longer compiles in release
>>>> >>>> mode
>>>> >>>> (debug and relwithdebinfo compile fine). The error is given below.
>>>> >>>> The code
>>>> >>>> used is:
>>>> >>>>
>>>> >>>> #include "itkTriangleCell.h"
>>>> >>>> //other includes
>>>> >>>>
>>>> >>>> typedef MeshType::CellType CellType;
>>>> >>>> typedef CellType::CellAutoPointer CellAutoPointer;
>>>> >>>> typedef itk::TriangleCell< CellType > TriangleType;
>>>> >>>>
>>>> >>>> //later I use it:
>>>> >>>> CellAutoPointer tr;
>>>> >>>> tr.TakeOwnership(new TriangleType);
>>>> >>>>
>>>> >>>> Any hints about how to fix it?
>>>> >>>>
>>>> >>>> Regards,
>>>> >>>> Dženan
>>>> >>>>
>>>> >>>> error LNK2019: unresolved external symbol "public: virtual __cdecl
>>>> >>>> itk::TriangleCellTopology::~TriangleCellTopology(void)"
>>>> >>>> (??1TriangleCellTopology at itk@@UEAA at XZ) referenced in function "int
>>>> >>>> `public:
>>>> >>>> __cdecl itk::TriangleCell<class itk::CellInterface<float,class
>>>> >>>> itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned
>>>> >>>> __int64,unsigned
>>>> >>>> __int64,class itk::Point<float,3>,class
>>>> >>>> itk::VectorContainer<unsigned
>>>> >>>> __int64,class itk::Point<float,3> >,class std::set<unsigned
>>>> >>>> __int64,struct
>>>> >>>> std::less<unsigned __int64>,class std::allocator<unsigned __int64>
>>>> >>>> > > >
>>>> >>>> >::TriangleCell<class itk::CellInterface<float,class
>>>> >>>> itk::CellTraitsInfo<3,float,float,unsigned __int64,unsigned
>>>> >>>> __int64,unsigned
>>>> >>>> __int64,class itk::Point<float,3>,class
>>>> >>>> itk::VectorContainer<unsigned
>>>> >>>> __int64,class itk::Point<float,3> >,class std::set<unsigned
>>>> >>>> __int64,struct
>>>> >>>> std::less<unsigned __int64>,class std::allocator<unsigned __int64>
>>>> >>>> > > >
>>>> >>>> >(void)'::`1'::dtor$1"
>>>> >>>>
>>>> >>>> (?dtor$1@?0???0?$TriangleCell at V?$CellInterface at MV?$CellTraitsInfo@$02MM_K_K_KV?$Point at M$02 at itk@@V?$VectorContainer at _KV?$Point at M$02 at itk@@@2 at V?$set at _KU?$less at _K@std@@V?$allocator at _K@2@@std@@@itk@@@itk@@@itk@@QEAA at XZ@4HA)
>>>> >>>>
>>>> >>>>
>>>> >>>> <ATT00001.txt>
>>>> >>>
>>>> >>
>>>> >>
>>>> >> <ATT00001.txt>
>>>> >
>>>> >
>>>> > _____________________________________
>>>> > Powered by www.kitware.com
>>>> >
>>>> > Visit other Kitware open-source projects at
>>>> > http://www.kitware.com/opensource/opensource.html
>>>> >
>>>> > Kitware offers ITK Training Courses, for more information visit:
>>>> > http://www.kitware.com/products/protraining.html
>>>> >
>>>> > Please keep messages on-topic and check the ITK FAQ at:
>>>> > http://www.itk.org/Wiki/ITK_FAQ
>>>> >
>>>> > Follow this link to subscribe/unsubscribe:
>>>> > http://www.itk.org/mailman/listinfo/insight-users
>>>> >
>>>> >
>>>
>>>
>>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
--
Unpaid intern in BillsBasement at noware dot com
More information about the Insight-users
mailing list