class="iteye-blog-content-contain">CentOS release 6.5 (Final)
?
#include <cstdlib> #include <iostream> #include "mongo/client/dbclient.h" void run() { mongo::DBClientConnection c; c.connect("localhost"); } int main(int argc,char*argv[]) { run(); return EXIT_SUCCESS; }
上面cpp命名为b.cpp
g++ b.cpp -lmongoclient
./a.out
没啥异常,就算搞定了。