Coder Social home page Coder Social logo

Error linking TIFF on Ubuntu about libgeotiff HOT 6 OPEN

osgeo avatar osgeo commented on May 31, 2024
Error linking TIFF on Ubuntu

from libgeotiff.

Comments (6)

NikkittaP avatar NikkittaP commented on May 31, 2024

I'm still facing the same problem on Ubuntu 18.04. Any ideas?

from libgeotiff.

NikkittaP avatar NikkittaP commented on May 31, 2024

Oookaay, here is my solution for now:

In the main CMakeLists.txt I commented out lines 179-189.
These lines checks functions in TIFF library and somehow it fails on Linux.
I will add more info if I have any problems while using this built libgeotiff library.

from libgeotiff.

attilaolah avatar attilaolah commented on May 31, 2024

I think this can be fixed by adding this line to CMakeLists.txt:

cmake_policy(SET CMP0075 NEW)

Specifically, the CMake checks don't seem to honor the CMAKE_REQUIRED_LIBRARIES. This causes failure when you try to link against libraries on your system.

from libgeotiff.

attilaolah avatar attilaolah commented on May 31, 2024

Another option is to pass -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY to cmake.

from libgeotiff.

lastant avatar lastant commented on May 31, 2024

For me this happened because cmake was looking for libtiff using FIND_PACKAGE and found it, but only the variables TIFF_FOUND, TIFF_DIR, TIFF_VERSION were set, the variable TIFF_LIBRARIES was not, but was needed. I actually had to explicitly set the libraries in the /usr/share/cmake-3.22/Modules/CheckFunctionExists.cmake file to circumvent the issue.

from libgeotiff.

mathstuf avatar mathstuf commented on May 31, 2024

Yes, the CMake package generated by libtiff upstream does not provide TIFF_LIBRARIES, so nothing ends up being passed to the try_compile for linking.in order to pass. The check needs reworked to handle this case. Something like this may be fine:

if (NOT TIFF_LIBRARIES AND TARGET TIFF::tiff)
  get_property(TIFF_LIBRARIES TARGET TIFF::tiff PROPERTY LOCATION)
  # request a `STATIC` library in `try_compile` as dependent libraries are not provided this way?
endif ()

from libgeotiff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.