Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2216

Static linking against libmongoc fails if it was built with bundled snappy

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: None
    • Component/s: None
    • None

      On my Mac, the default ./configure line uses bundled Snappy and generates libmongoc-static-1.0-config.cmake with these libraries:

      -lsasl2 -lz libsnappy.la
      

      I think the syntax is wrong. Also, libsnappy.la is not installed by "make install". Building libmongoc with the Autotools and then linking a program to libmongoc using the CMake configuration file fails:

      > BUILD_SAMPLE_WITH_CMAKE=1 BUILD_LIBMONGOC_WITH_CMAKE=  LINK_STATIC=1 sh .evergreen/link-sample-program.sh
      ...
      ld: library not found for -llibsnappy.la
      

      Same for building libmongoc with CMake.

      Linking a program to the libmongoc shared lib seems to work fine.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: