undefined reference to mongo::curTimeMillis64()

From: Emanuele <carbeman@xxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Fri, 22 Apr 2016 05:21:41 -0700 (PDT)
Why ads?
Hi,

someone can help me with this issue?

i have this sample code:

#include <iostream>
#include <mongo/util/time_support.h>

using namespace std;

int main()
{
    cout << mongo::curTimeMillis64() << endl;
    return 0;
}

and compile with:

g++ -I/tmp/include prova.cpp -o prova -L/tmp/lib -lmongoclient

the result is:

/tmp/ccH0vDvx.o: In function `main':
prova.cpp:(.text+0x5): undefined reference to `mongo::curTimeMillis64()'
collect2: error: ld returned 1 exit status

I use the 26compat of mongo cxx driver and i have also check with nm the 
symbols within the library:

nm /tmp/lib/libmongoclient.so | grep curTime
00000000000ea510 t _ZN5mongo13curTimeMicrosEv
00000000000ea4f0 t _ZN5mongo15curTimeMicros64Ev
00000000000ea440 t _ZN5mongo15curTimeMillis64Ev

everything seems to be ok but the compile fails. Any suggestions?

Thanks

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/b7b45aac-9806-448b-87d7-a511773acd99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?