Got mongocxx.lib instead of libmongocxx.lib for C++ Driver VS 2015

60 views
Skip to first unread message

Richard P

unread,
May 13, 2018, 11:48:09 PM5/13/18
to mongodb-user
Hi everyone, I'm totally new in MongoDB and want to learn how to use it.
I tried implementing C++ driver for MongoDB in this tutorial. (https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/tutorial/)

I use MS VS 2015.

I successfully install MongoDB, mongo-c-driver and managed to compile mongo-cxx-driver as well. However I have several questions:
  1. I got mongocxx.lib instead of libmongocxx.lib
  2. I tried to create example project in the tutorial, but it resulting in error
    unresolved external symbol __imp__invalid_parameter
    unresolved external symbol __imp__CrtDbgReportW
    and some other error (total it has 4 errors)
  3. I tried to execute test_driver.exe but it needs crud_tests_data <- what I should supply within this variable?
I'm wondering whether I did wrong in the installation, but I make sure that I install Release version with x64 target. I hope someone could help me. I'm new in this mailing list as well, I have tried to search for information, but can't find libmongocxx.lib problem like mine.

Thanks in advance,
Richard

郭孟勳

unread,
May 14, 2018, 9:10:05 PM5/14/18
to mongodb-user
Hi Richard 

I just went through the installation process. Maybe my experience can help you.

  1. I think those two .lib is the same one. Because I install mongo-c-driver 1.9.4 and 1.9.5 version both and resulted in different name of .lib file
  2. Well, I think there is some mistake when you include and link the library files
    • Following is my VS2017 setup
      • Configuration Manager > Active Solution Platform: x64
      • C/C++ > Additional Include Directories: C:\mongo-c-driver\include\libbson-1.0;C:\mongo-c-driver\include\libmongoc-1.0;C:\mongo-cxx-driver\include\bsoncxx\v_noabi;C:\mongo-cxx-driver\include\mongocxx\v_noabi;C:\Program Files\boost\boost_1_62_0;
      • Linker > Additional Library Directories: C:\mongo-cxx-driver\lib;
      • Linker > Input > Additional Dependencies: bsoncxx.lib;mongocxx.lib;
  3. I didn't try this exe file, so I cannot help this
Hope this can help you

Best Regards, 
Jimmy

Richard P

unread,
May 15, 2018, 7:34:20 PM5/15/18
to mongodb-user
Thank you. I have successfully build it. For anyone has problem with me:

1. I create a new project (empty project), copy paste the example, set the right build target (x86/x64) and make sure everything connected (look at Jimmy's setting).
2. I build mongo-cxx-driver at mongo-c-driver, so I modify it based on my installation.
3. As Jimmy said, mongocxx.lib and libmongocxx.lib are same. I copy it, and provide two file names inside my lib folder, just in case.
4. I encounter application crash during runtime, but simply because my MongoDB service hasn't started yet. After I started it, everything works like a charm.

Thank you again. I can't wait to use it.

Richard
Reply all
Reply to author
Forward
0 new messages