Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error "undefined reference" on Linux #16

Open
yash-jain16 opened this issue Jun 2, 2020 · 6 comments
Open

Linker error "undefined reference" on Linux #16

yash-jain16 opened this issue Jun 2, 2020 · 6 comments

Comments

@yash-jain16
Copy link

[ 75%] Linking CXX executable exactextract
libexactextract.a(geos_utils.cpp.o): In function exactextract::segment_intersection(GEOSContextHandle_HS*, exactextract::Coordinate const&, exactextract::Coordinate const&, exactextract::Coordinate const&, exactextract::Coordinate const&, exactextract::Coordinate&)': geos_utils.cpp:(.text+0x41c): undefined reference to GEOSSegmentIntersection_r'
libexactextract.a(geos_utils.cpp.o): In function exactextract::geos_get_box(GEOSContextHandle_HS*, GEOSGeom_t const*)': geos_utils.cpp:(.text+0x4ad): undefined reference to GEOSGeom_getXMin_r'
geos_utils.cpp:(.text+0x4c5): undefined reference to GEOSGeom_getYMin_r' geos_utils.cpp:(.text+0x4d9): undefined reference to GEOSGeom_getXMax_r'
geos_utils.cpp:(.text+0x4ed): undefined reference to GEOSGeom_getYMax_r' libexactextract.a(geos_utils.cpp.o): In function exactextract::geos_is_ccw(GEOSContextHandle_HS*, GEOSCoordSeq_t const*)':
geos_utils.cpp:(.text+0x5ac): undefined reference to GEOSCoordSeq_isCCW_r' libexactextract.a(geos_utils.cpp.o): In function exactextract::geos_get_component_boxes(GEOSContextHandle_HS*, GEOSGeom_t const*)':
geos_utils.cpp:(.text+0x92a): undefined reference to GEOSGeom_getXMin_r' geos_utils.cpp:(.text+0x93e): undefined reference to GEOSGeom_getYMin_r'
geos_utils.cpp:(.text+0x952): undefined reference to GEOSGeom_getXMax_r' geos_utils.cpp:(.text+0x966): undefined reference to GEOSGeom_getYMax_r'
/usr/lib/libgdal.so: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFClientdata@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to kmlengine::Href::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/lib/libgdal.so: undefined reference to xercesc_3_2::DOMImplementationRegistry::getDOMImplementation(char16_t const*)'
/usr/lib/libgdal.so: undefined reference to TIFFLastDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFReadRGBAStripExt@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSwabArrayOfShort@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFIsTiled@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFIsByteSwapped@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to kmlengine::KmzFile::ReadKmlAndGetPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const' /usr/lib/libgdal.so: undefined reference to TIFFFlushData@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFWriteCheck@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetWriteOffset@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFDefaultStripSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFScanlineSize64@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpoppler.so.73: undefined reference to TIFFFdOpen@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to kmldom::ParseNS(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)'
/usr/lib/libgdal.so: undefined reference to TIFFIsBigEndian@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFWriteScanline@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to xercesc_3_2::XSModel::getComponentsByNamespace(xercesc_3_2::XSConstants::COMPONENT_TYPE, char16_t const*)' /usr/lib/libgdal.so: undefined reference to _TIFFfree@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to kmlengine::KmzFile::OpenFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/lib/libgdal.so: undefined reference to TIFFSwabShort@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFFreeDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFGetField@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFNumberOfStrips@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFWriteBufferSetup@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFWriteEncodedTile@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to xercesc_3_2::InputSource::setEncoding(char16_t const*)' /usr/lib/libgdal.so: undefined reference to TIFFSwabLong@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFTileSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFWriteDirectory@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to xercesc_3_2::XMLString::transcode(char16_t const
, xercesc_3_2::MemoryManager*)'
/usr/lib/libgdal.so: undefined reference to TIFFClose@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFFlush@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFSetTagExtender@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFWriteRawStrip@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFErrorExt@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to kmldom::SerializePretty[abi:cxx11](boost::intrusive_ptr<kmldom::Element> const&)' /usr/lib/libgdal.so: undefined reference to TIFFGetFieldDefaulted@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFSwabArrayOfLong@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to kmldom::Parse(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)'
/usr/lib/libgdal.so: undefined reference to TIFFNumberOfDirectories@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFTileSize64@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to xercesc_3_2::XSModel::getElementDeclaration(char16_t const*, char16_t const*)' /usr/lib/libgdal.so: undefined reference to libdap::Connect::Connect(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)'
/usr/lib/libgdal.so: undefined reference to TIFFWriteRawTile@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to xercesc_3_2::XMLString::release(char16_t**, xercesc_3_2::MemoryManager
)'
/usr/lib/libgdal.so: undefined reference to TIFFStripSize64@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFCreateDirectory@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to xercesc_3_2::InputSource::setPublicId(char16_t const*)' /usr/lib/libgdal.so: undefined reference to TIFFSetSubDirectory@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to xercesc_3_2::InputSource::setSystemId(char16_t const*)' /usr/lib/libgdal.so: undefined reference to TIFFStripSize@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFSwabArrayOfDouble@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFReadRGBATileExt@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFUnlinkDirectory@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFUnsetField@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetField@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFMergeFieldInfo@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFCurrentDirOffset@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFIsCODECConfigured@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to kmlengine::KmzFile::ReadFile(char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >*) const'
/usr/lib/libgdal.so: undefined reference to TIFFDataWidth@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFGetConfiguredCODECs@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFGetSizeProc@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFRewriteDirectory@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to TIFFSetDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFReadScanline@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to `TIFFNumberOfTiles@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
CMakeFiles/exactextract_bin.dir/build.make:181: recipe for target 'exactextract' failed
make[2]: *** [exactextract] Error 1
CMakeFiles/Makefile2:155: recipe for target 'CMakeFiles/exactextract_bin.dir/all' failed
make[1]: *** [CMakeFiles/exactextract_bin.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

@dbaston
Copy link
Member

dbaston commented Jun 2, 2020

Not sure what would cause this, though you previously built it successfully, no? Can you describe your build environment?

@yash-jain16
Copy link
Author

Yes, it is working for me inside Docker, but I want to execute it directly on my machine.
So I am using a Linux machine on AWS EC2 (Linux 5.3.0-1019-aws x86_64) I have gdal and CMake(3.17) already installed there

@dbaston
Copy link
Member

dbaston commented Jun 4, 2020

Which Linux distribution? How were GDAL and GEOS installed?

@yash-jain16
Copy link
Author

Linux is Ubuntu bionic
Ubuntu 18.04 LTS

GDAL and GEOS installed using anaconda env in python

@dbaston
Copy link
Member

dbaston commented Jun 4, 2020

Ah, the conda env is probably screwing with the linking. Why not just install GDAL and GEOS via apt?

@yash-jain16
Copy link
Author

yash-jain16 commented Jun 5, 2020

Hey, so I tried this way and it executed properly till "make" but on "sudo make install" I have the following error:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants