[CDRIVER-2079] Link error due to undefined reference to `assert' Created: 07/Mar/17  Updated: 06/Apr/23  Resolved: 14/Mar/17

Status: Closed
Project: C Driver
Component/s: Build, errors, libmongoc
Affects Version/s: None
Fix Version/s: 1.7.0

Type: Bug Priority: Trivial - P5
Reporter: Carlos Rosales Gallegos Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 16.04, Desktop


Issue Links:
Related
is related to CDRIVER-2005 release-compile task on Evergreen Win... Closed

 Description   

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



 Comments   
Comment by Hannes Magnusson [ 14/Mar/17 ]

thanks for confirming!

Comment by Carlos Rosales Gallegos [ 14/Mar/17 ]

Whops, I can't close it or mark it as resolved, first time in JIRA

Thanks

Comment by Carlos Rosales Gallegos [ 14/Mar/17 ]

Yes, the compilation works perfectly now, issue solved in `master`, thanks!

Closing it.

Comment by Hannes Magnusson [ 14/Mar/17 ]

Can you try current master?
I had related un-committed changes a while ago that I pushed yesterday, see CDRIVER-2005

Comment by A. Jesse Jiryu Davis [ 10/Mar/17 ]

Thanks for the report and the diff, we'll handle this in the next release.

Generated at Wed Feb 07 21:14:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.