<div dir="ltr"><div>Thanks Niels. Let us know if you are running into any problem during that process.<br><br></div>Francois<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 11, 2017 at 11:49 AM, Niels Dekker <span dir="ltr"><<a href="mailto:niels-xtk@xs4all.nl" target="_blank">niels-xtk@xs4all.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you for your supportive replies, Matt and Francois. My colleague Floris Berendsen and I will try to submit a patch for this issue later this week.<br>
<br>
Kind regards, Niels<span class=""><br>
<br>
Francois Budin wrote op 2017-04-11 15:35:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hello Niels,<br>
<br>
Thank you for reporting this issue. I looked into itk_png_mangle.h and<br>
indeed it looks like the function 'png_get_uint_31' should be renamed<br>
and is not.<br>
Using this command [1], updated to your ITK version, you should be<br>
able to see the the functions that are missing and need to be added to<br>
itk_png_mangle.h .<br>
It would be great if you commit submit a patch to ITK to correct this<br>
issue.<br>
You can find step by step instructions about how to contribute here<br>
[2]. Feel free to reach out if you have any problem during this<br>
process.<br>
<br>
Thank you so much for your help,<br>
Francois<br>
<br>
[1]<br>
<a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/PNG/src/itkpng/itk_png_mangle.h#L13-L15" rel="noreferrer" target="_blank">https://github.com/InsightSoft<wbr>wareConsortium/ITK/blob/<wbr>master/Modules/ThirdParty/PNG/<wbr>src/itkpng/itk_png_mangle.h#<wbr>L13-L15</a><br>
[2] <a href="https://itk.org/Wiki/ITK/Git/Develop" rel="noreferrer" target="_blank">https://itk.org/Wiki/ITK/Git/D<wbr>evelop</a><br>
<br></span><div><div class="h5">
On Tue, Apr 11, 2017 at 9:11 AM, Niels Dekker wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When trying build our project, which links statically to both ITK<br>
and the Niftyreg library, my colleague Floris Berendsen and I<br>
encountered the following link error:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
itkpng-4.10.lib(pngrutil.obj) : error LNK2005: png_get_uint_31<br>
</blockquote>
already defined in png.lib(pngrutil.obj)<br>
[...\SuperElastix-build\Testin<wbr>g\Unit\selxAnyFileIOTest.<wbr>vcxproj]<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
...\SuperElastix-build\bin\Deb<wbr>ug\selxAnyFileIOTest.exe : fatal<br>
</blockquote>
error LNK1169: one or more multiply defined symbols found<br>
[...\SuperElastix-build\Testin<wbr>g\Unit\selxAnyFileIOTest.<wbr>vcxproj]<br>
<br>
It appears that ITK and Niftyreg link to different versions of<br>
libpng. Fortunately, ITK has done name mangling for most of the<br>
libpng API functions, to avoid such linking errors, as we can see at<br>
Modules/ThirdParty/PNG/src/itk<wbr>png/itk_png_mangle.h  Now it appears<br>
that the function "png_get_uint_31" is also exported by libpng, but<br>
that function is not mangled by ITK! We could locally fix our link<br>
error by adding an extra #define to "itk_png_mangle.h":<br>
<br>
#define png_get_uint_31 itk_png_get_uint_31<br>
<br>
Do you guys agree that that would be an appropriate fix? Could such<br>
a fix be added to the ITK code base?<br>
<br>
Kind regards, Niels<br>
<br>
PS Our project, SuperElastix, can be found at<br>
<a href="https://github.com/SuperElastix/SuperElastix" rel="noreferrer" target="_blank">https://github.com/SuperElasti<wbr>x/SuperElastix</a>  (We tried to build<br>
the SuperBuild from the development branch.) The Nifty Reg library<br>
is from <a href="https://cmiclab.cs.ucl.ac.uk/mmodat/niftyreg" rel="noreferrer" target="_blank">https://cmiclab.cs.ucl.ac.uk/m<wbr>modat/niftyreg</a><br>
</blockquote></div></div></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Niels Dekker<br>
Scientific programmer<br>
LKEB, Leiden University Medical Center, Netherlands<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://kitware.com/products/pr<wbr>otraining.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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-developer<wbr>s</a><br>
</div></div></blockquote></div><br></div>