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

Link error due to undefined reference to `assert'

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.7.0
    • Affects Version/s: None
    • Component/s: Build, errors, libmongoc
    • None
    • Environment:
      Ubuntu 16.04, Desktop

      I'm not sure what changed in my system, because about two months ago, I built the C driver from source without problems.

      But after a pull and/or a fresh clone of the master branch, and several versions checked out, using cmake build, I get the following error:

      libmongoc-1.0.so.1.7.0-dev: undefined reference to `assert'
      collect2: error: ld returned 1 exit status
      

      There were some files with the following warning:

      warning: implicit declaration of function ‘assert’ [-Wimplicit-function-declaration]

      Solution, if this is really an issue, is to include <assert.h> in the affected files. This commit in facts shows the diff that works for me.

      Btw, I'm building libbson from source as well.

      Best

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            carlos@beta-robots.com Carlos Rosales Gallegos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: