[CDRIVER-515] Undefined reference "bson_atomic_int64_add" on 32bit embed system Created: 23/Jan/15  Updated: 08/Jan/24  Resolved: 18/May/15

Status: Closed
Project: C Driver
Component/s: Build, libbson
Affects Version/s: None
Fix Version/s: 1.1.5

Type: Bug Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CDRIVER-514 undefined reference to `bson_atomic_i... Closed

 Description   

(ported from github)

I want to port the mongoc_driver to my raspberry pi but there is an issues when I compile the driver under the the raspberry pi with raspbian system.
The compiler said: Undifined reference "bson_atomic_int64_add".
The raspberry pi only support 32 bit system and I have installed a raspbian system with gcc and g++ for it.

I have tried to use the cross toolchain to build the driver and it has been done without errors.
But I think there is some difference because the os of the host is a 64bit system and the 'bson_atomic_int64_add' was supported.

I prefer the mongoc driver than mongoc++ driver because I didn't want to install boost library for raspbian.

Can any body tell me how to fixed the issue?
I hope the mongoc driver can be compiled under raspbian system.



 Comments   
Comment by A. Jesse Jiryu Davis [ 18/May/15 ]

Fixed in https://github.com/mongodb/libbson/commit/d2f337ef14f694d0b35a6ce5a06efa4e299d7d00

Comment by azd [ 21/Feb/15 ]

Hi, i have the same problem in my raspberry :
Version GCC : gcc (Debian 4.6.3-14+rpi1) 4.6.3
Version rasp : wheezy armv6l GNU/Linux

Hope to get solution. Thanks.

Stack trace :
CCLD mongoc-stat
CC tests/test_load-test-load.o
CC tests/test_load-mongoc-tests.o
CCLD test-load
./.libs/libmongoc-priv.so: undefined reference to `bson_atomic_int64_add'
collect2: ld returned 1 exit status
Makefile:2043: recipe for target 'test-load' failed
make[1]: *** [test-load] Error 1
make[1]: Leaving directory '/home/pi/telechargement/mongo-c-driver-1.1.0'
Makefile:3727: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

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