Hello Niels, Thank you for reporting this issue. I looked into itk_png_mangle.h and indeed it looks like the function 'png_get_uint_31' should be renamed and is not. Using this command [1], updated to your ITK version, you should be able to see the the functions that are missing and need to be added to itk_png_mangle.h . It would be great if you commit submit a patch to ITK to correct this issue. You can find step by step instructions about how to contribute here [2]. Feel free to reach out if you have any problem during this process.
Thank you so much for your help, Francois [1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/PNG/src/itkpng/itk_png_mangle.h#L13-L15 [2] https://itk.org/Wiki/ITK/Git/Develop On Tue, Apr 11, 2017 at 9:11 AM, Niels Dekker <niels-...@xs4all.nl> wrote: > When trying build our project, which links statically to both ITK and the > Niftyreg library, my colleague Floris Berendsen and I encountered the > following link error: > > >itkpng-4.10.lib(pngrutil.obj) : error LNK2005: png_get_uint_31 already > defined in png.lib(pngrutil.obj) [...\SuperElastix-build\Testin > g\Unit\selxAnyFileIOTest.vcxproj] > >...\SuperElastix-build\bin\Debug\selxAnyFileIOTest.exe : fatal error > LNK1169: one or more multiply defined symbols found > [...\SuperElastix-build\Testing\Unit\selxAnyFileIOTest.vcxproj] > > It appears that ITK and Niftyreg link to different versions of libpng. > Fortunately, ITK has done name mangling for most of the libpng API > functions, to avoid such linking errors, as we can see at > Modules/ThirdParty/PNG/src/itkpng/itk_png_mangle.h Now it appears that > the function "png_get_uint_31" is also exported by libpng, but that > function is not mangled by ITK! We could locally fix our link error by > adding an extra #define to "itk_png_mangle.h": > > #define png_get_uint_31 itk_png_get_uint_31 > > Do you guys agree that that would be an appropriate fix? Could such a fix > be added to the ITK code base? > > Kind regards, Niels > > PS Our project, SuperElastix, can be found at > https://github.com/SuperElastix/SuperElastix (We tried to build the > SuperBuild from the development branch.) The Nifty Reg library is from > https://cmiclab.cs.ucl.ac.uk/mmodat/niftyreg > > -- > Niels Dekker > Scientific programmer > LKEB, Leiden University Medical Center, Netherlands > _______________________________________________ > 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://kitware.com/products/protraining.php > > 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://public.kitware.com/mailman/listinfo/insight-developers >
_______________________________________________ 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://kitware.com/products/protraining.php 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://public.kitware.com/mailman/listinfo/insight-developers