Hello everybody,
I have found some issues with the installation of OTB-6.4 from OTB webpage
(https://www.orfeo-toolbox.org/) and an initial simple application
compilation using CMake on a VM GNU/Linux Ubuntu 16.04 distribution.
Although I follow the installation guide:
https://www.orfeo-toolbox.org/packages/OTBSoftwareGuide.pdf
and the Building Simple Application tutorial from the Software guide:
https://www.orfeo-toolbox.org/SoftwareGuide/SoftwareGuidech4.html
It never compiles ("make" command). I am frustrated because it seems the
most basic compilation possible but the OTB guides I have found are someway
contradictory (some guides talk about folders I don't have, for example,
the Examples folders is not in my installation).
I have created a folder for this purpose from where I execute the make
commands and I have the cxx file with the C++ sample code:
${Home}/workspace/otb_tutorials
and attached into this message you can find the CMakeLists.txt and
HelloWorldOTB.cxx files that were copied from the Simple Application
tutorial previously mentioned plus the output message
(error_message_make.txt) after executing the "make" command.
In my opinion, a way of solving this (partially), may be the addition of
following lines into the CMakeList.txt file:
INCLUDE_DIRECTORIES(${HOME}/workspace/OTB-6.4.0-Linux64/include)
INCLUDE_DIRECTORIES(${HOME}/workspace/OTB-6.4.0-Linux64/include/boost-1_60)
INCLUDE_DIRECTORIES(${HOME}/workspace/OTB-6.4.0-Linux64/include/ITK-4.12)
Which passes the "cmake .\" command (in both cases this command is
succesfull) but also outputs some errors in the "make" command.
I have been working with QGIS lately, not very deeply but it is useful for
some of my research related to precision agriculture. I would like to
create my own software C++ using OTB. So if anyone can help me it will be
very useful for me but maybe also for others beginners with OTB.
Thank you very much in advance for your time reading this ( and maybe
answering :-D ),
Enric.
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
PROJECT(Tutorials)
cmake_minimum_required(VERSION 2.6)
FIND_PACKAGE(OTB)
IF(OTB_FOUND)
INCLUDE(${OTB_USE_FILE})
ELSE(OTB_FOUND)
MESSAGE(FATAL_ERROR
"Cannot build OTB project without OTB. Please set OTB_DIR.")
ENDIF(OTB_FOUND)
ADD_EXECUTABLE(HelloWorldOTB HelloWorldOTB.cxx )
TARGET_LINK_LIBRARIES(HelloWorldOTB ${OTB_LIBRARIES})
[ 50%] Building CXX object CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o
[100%] Linking CXX executable HelloWorldOTB
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función
`itk::MemoryAllocationError::MemoryAllocationError(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, unsigned int,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)':
HelloWorldOTB.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjS8_S8_[_ZN3itk21MemoryAllocationErrorC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjS8_S8_]+0x35):
referencia a
`itk::ExceptionObject::ExceptionObject(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, unsigned int,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función
`otb::Image<unsigned short, 2u>::GetProjectionRef() const':
HelloWorldOTB.cxx:(.text._ZNK3otb5ImageItLj2EE16GetProjectionRefEv[_ZNK3otb5ImageItLj2EE16GetProjectionRefEv]+0x4d):
referencia a `otb::ImageMetadataInterfaceBase::GetProjectionRef[abi:cxx11]()
const' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función
`otb::Image<unsigned short, 2u>::GetGCPProjection() const':
HelloWorldOTB.cxx:(.text._ZNK3otb5ImageItLj2EE16GetGCPProjectionEv[_ZNK3otb5ImageItLj2EE16GetGCPProjectionEv]+0x4d):
referencia a `otb::ImageMetadataInterfaceBase::GetGCPProjection[abi:cxx11]()
const' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función
`otb::Image<unsigned short, 2u>::GetGCPId(unsigned int) const':
HelloWorldOTB.cxx:(.text._ZNK3otb5ImageItLj2EE8GetGCPIdEj[_ZNK3otb5ImageItLj2EE8GetGCPIdEj]+0x53):
referencia a `otb::ImageMetadataInterfaceBase::GetGCPId[abi:cxx11](unsigned
int) const' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función
`otb::Image<unsigned short, 2u>::GetGCPInfo(unsigned int) const':
HelloWorldOTB.cxx:(.text._ZNK3otb5ImageItLj2EE10GetGCPInfoEj[_ZNK3otb5ImageItLj2EE10GetGCPInfoEj]+0x53):
referencia a `otb::ImageMetadataInterfaceBase::GetGCPInfo[abi:cxx11](unsigned
int) const' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función `bool
itk::ExposeMetaData<otb::ImageKeywordlist>(itk::MetaDataDictionary const&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>, otb::ImageKeywordlist&)':
HelloWorldOTB.cxx:(.text._ZN3itk14ExposeMetaDataIN3otb16ImageKeywordlistEEEbRKNS_18MetaDataDictionaryENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERT_[_ZN3itk14ExposeMetaDataIN3otb16ImageKeywordlistEEEbRKNS_18MetaDataDictionaryENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERT_]+0x33):
referencia a `itk::MetaDataDictionary::HasKey(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) const' sin definir
HelloWorldOTB.cxx:(.text._ZN3itk14ExposeMetaDataIN3otb16ImageKeywordlistEEEbRKNS_18MetaDataDictionaryENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERT_[_ZN3itk14ExposeMetaDataIN3otb16ImageKeywordlistEEEbRKNS_18MetaDataDictionaryENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERT_]+0x57):
referencia a
`itk::MetaDataDictionary::operator[](std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) const' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función `void
itk::EncapsulateMetaData<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > >(itk::MetaDataDictionary&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)':
HelloWorldOTB.cxx:(.text._ZN3itk19EncapsulateMetaDataINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRNS_18MetaDataDictionaryERKS6_RKT_[_ZN3itk19EncapsulateMetaDataINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRNS_18MetaDataDictionaryERKS6_RKT_]+0x2c):
referencia a `itk::MetaDataObject<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > >::New()' sin definir
HelloWorldOTB.cxx:(.text._ZN3itk19EncapsulateMetaDataINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRNS_18MetaDataDictionaryERKS6_RKT_[_ZN3itk19EncapsulateMetaDataINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRNS_18MetaDataDictionaryERKS6_RKT_]+0x4a):
referencia a `itk::MetaDataObject<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >
>::SetMetaDataObjectValue(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)' sin definir
HelloWorldOTB.cxx:(.text._ZN3itk19EncapsulateMetaDataINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRNS_18MetaDataDictionaryERKS6_RKT_[_ZN3itk19EncapsulateMetaDataINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRNS_18MetaDataDictionaryERKS6_RKT_]+0x6c):
referencia a
`itk::MetaDataDictionary::operator[](std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)' sin definir
CMakeFiles/HelloWorldOTB.dir/HelloWorldOTB.cxx.o: En la función `void
itk::EncapsulateMetaData<otb::ImageKeywordlist>(itk::MetaDataDictionary&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, otb::ImageKeywordlist const&)':
HelloWorldOTB.cxx:(.text._ZN3itk19EncapsulateMetaDataIN3otb16ImageKeywordlistEEEvRNS_18MetaDataDictionaryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_[_ZN3itk19EncapsulateMetaDataIN3otb16ImageKeywordlistEEEvRNS_18MetaDataDictionaryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_]+0x6c):
referencia a
`itk::MetaDataDictionary::operator[](std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)' sin definir
collect2: error: ld returned 1 exit status
CMakeFiles/HelloWorldOTB.dir/build.make:226: fallo en las instrucciones para el
objetivo 'HelloWorldOTB'
make[2]: *** [HelloWorldOTB] Error 1
CMakeFiles/Makefile2:67: fallo en las instrucciones para el objetivo
'CMakeFiles/HelloWorldOTB.dir/all'
make[1]: *** [CMakeFiles/HelloWorldOTB.dir/all] Error 2
Makefile:83: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2
#include "otbImage.h"
#include <iostream>
int main(int argc, char ** argv){
typedef otb::Image<unsigned short, 2> ImageType;
ImageType::Pointer image = ImageType::New();
std::cout << "OTB Hello World !" << std::endl;
return EXIT_SUCCESS;
}