2

I added,

I$(MONGODBCDRIVER)/inlcude/libmongoc-1.0 -L$(MONGODBCDRIVER)/lib -lmongoc-1.0 to g++ and it works.

But I deleted -L$(MONGODBCDRIVER)/lib, it still works. Why?

Another question, what does lmongoc-1.0 means?

Is it to link the libmongoc-1.0.la in the $(MONGODBCDRIVER)/lib directory?

Suvarna Pattayil
  • 5,136
  • 5
  • 32
  • 59
BAE
  • 8,550
  • 22
  • 88
  • 171
  • It looks like you're trying to link the MongoDB C library into your C++ project. Perhaps you instead meant to use the [MongoDB C++ Driver](https://github.com/mongodb/mongo-cxx-driver)? Information on gcc/G++ options can be found in the [G++ man page](http://linux.die.net/man/1/g++). The `-L` and `-l` options relate to directory and library paths to search for when linking. If you want to understand why your program works without the libmongoc path you'd have to provide more output from actual compilation/linking. I'd guess libmongoc isn't used or can already be found via your default libpath. – Stennie Jan 15 '15 at 04:06
  • Thanks. mongodb c++ driver depends on boost 1.49, but now my linux version only support boost 1.46. Another point is that mongodb c driver has better documents. – BAE Jan 15 '15 at 16:14

0 Answers0