私は助けが必要です!LinuxでC ++ mongoプロジェクトをコンパイルするには?
私はこれをやっています:1)ブーストをインストールします2)mongodbドライバーをコンパイルします3)例をコンパイルしてみてください(失敗)
コンパイルした mongodb ドライバーは /home/developer/documents/drivers/mongo-cxx-driver-v2.4/build にあります
このファイルをコンパイルしようとしています
#include <cstdlib>
#include <iostream>
#include "mongo/client/dbclient.h"
void run() {
mongo::DBClientConnection c;
c.connect("localhost");
}
int main() {
try {
run();
std::cout << "connected ok" << std::endl;
} catch( const mongo::DBException &e ) {
std::cout << "caught " << e.what() << std::endl;
}
return EXIT_SUCCESS;
}
そして、次のコマンドを実行します: g++ tutorial.cpp -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system -o tutorial
このコマンドは失敗します。エラー メッセージ - 「mongo/client/dbclient.h」が見つかりません。この例をコンパイルするには? お願い助けて!