Skip to content

Fix various compilation errors (gcc10, mscv 2019)

Cédric Traizet requested to merge 2045-debian-gcc-10 into develop

Summary

OTB does not compile with gcc-10.

See #2045 (closed)

WIP: this does not solves all compilation issues yet. A build on bullseye (29/07/2020) with gcc 10 leads to the following results :

[ 78%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperStringListInterface.cxx.o
[ 78%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperStringListParameter.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperAbstractParameterList.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperParameterList.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperBoolParameter.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperMetaDataHelper.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperParameter.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperCastImage.cxx.o
[ 79%] Building CXX object Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/otbWrapperTypes.cxx.o
make[2]: Entering directory '/build'
Scanning dependencies of target OTBTestKernel-all
make[2]: Leaving directory '/build'
[ 79%] Built target OTBTestKernel-all
[ 79%] Linking CXX shared library ../../../../lib/libOTBApplicationEngine-7.1.so
/usr/bin/ld: CMakeFiles/OTBApplicationEngine.dir/otbWrapperApplicationRegistry.cxx.o: in function `otb::Wrapper::ApplicationRegistry::GetAvailableApplications[abi:cxx11](bool)':
otbWrapperApplicationRegistry.cxx:(.text+0x286f): undefined reference to `itk::Directory::GetNumberOfFiles[abi:cxx11]()'
collect2: error: ld returned 1 exit status
make[2]: *** [Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/build.make:726: lib/libOTBApplicationEngine-7.1.so.1] Error 1
make[2]: Leaving directory '/build'
make[1]: *** [CMakeFiles/Makefile2:5468: Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/all] Error 2
make[1]: Leaving directory '/build'
make: *** [Makefile:130: all] Error 2

itk::Directory::GetNumberOfFiles[abi:cxx11]() should be found in the ITKCommon library.

The same build with gcc-9 was successful.

A build on sid (29/07/2020) where gcc-10 is the default gcc leads to the same results.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports