Errors when linking bson-cxx library

45 views
Skip to first unread message

A440

unread,
Oct 25, 2016, 3:59:34 PM10/25/16
to BSON
Hello,

I am attempting to use this library to parse BSON:


The source files compile fine, but when I go to link and build the example program I get the following error:

  clang++ example1.o base64.o bson.o hex.o json.o  parse_number.o time_support.o valid.o -o program
 Undefined symbols for architecture x86_64:
   "_bson::bsonelement::Obj() const", referenced from:
       _bson::bsonelement::Array() const in valid.o


There is a member function of class bsonelement that is declared in bsonelement.h 

  bsonobj Obj()               const;

but it is not defined or instantiated anywhere in the source files, as far as I can tell.

Has anyone used this library?  Any suggestions?  The error message from the linker is as follows:

Thanks!

Dwight Merriman

unread,
Nov 8, 2016, 3:16:53 PM11/8/16
to BSON
yes there is an issue.  i believe if you leave valid.o off the command line it will then build.  

i will try to clean up valid and bsonelement sometime soon.  the intent was for object() to be used rather than Obj() iirc.

Dwight Merriman

unread,
Nov 8, 2016, 3:25:31 PM11/8/16
to BSON
i just pushed a commit which may help


On Tuesday, October 25, 2016 at 3:59:34 PM UTC-4, A440 wrote:
Reply all
Reply to author
Forward
0 new messages