[CXX-1437] inking errors when building c++ project using mongo-cxx-driver Created: 22/Sep/17 Updated: 14/Nov/17 Resolved: 22/Sep/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | 3.1.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | David Newman | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: macOS Sierra 10.12.6 |
||
| Description |
|
I am currently developing a C++ application which requires the use of the mongo-cxx-driver for accessing a MongoDB instance. I attempted a couple of methods of installation, and am met with the same linker issues each time. Initially, I attempted to install mongo-cxx-drivers and mongod-c-driver as detailed here: https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/ Using the following portion of my CMake configuration, I was able to get auto-completion working and my IDE to recognize the libraries:
Unfortunately during the linking stage, I get these errors:
I tried building using different c++17 polyfills just in case, no go. I also tried manually uninstalling mongo-cxx-driver and mongo-c-driver this time installing thru homebrew, but was met with the same errors. In my research, the most relatable StackOverflow post is Using the mongodb cxx driver in a cmake c++ project, yet none of the solutions there work for me. Operating System: macOS Sierra 10.12.6 Any help or insight would be much appreciated, please feel free to ask me to clarify or add information where it may be unclear or missing.
Note: I also have opened a StackOverflow question as this is a fairly time sensitive issue for me. |
| Comments |
| Comment by David Newman [ 22/Sep/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Works like a charm | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 22/Sep/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
OK, so based on this line in that output:
It doesn't look to me like the mongocxx or bsoncxx libraries are on the link line. I suspect something is going wrong with your COMMON_LIBRARIES variable. Can you try changing this line
To
And re-post the verbose build output? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Newman [ 22/Sep/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for taking a look, it's much appreciated. I have XCode 9.0 installed currently. I should have thought to include that hehe Anyway, I went ahead and created a simple project from scratch this morning and went through all the steps again just to be sure I didn't flub anything. Still in the same boat at the end though Here is the CMake output for the project:
Here is the full output when building with verbose mode enabled for CMake:
The full CMakeLists.txt:
The code itself producing the errors:
If there is anything else you need on my part, let me know. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 22/Sep/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also, what version of XCode do you have installed? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 22/Sep/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you for filing a detailed ticket. I'm going to attempt to reproduce the issue with the code you provided. From a quick look I don't see anything wrong with it though. Meanwhile, since this is urgent, could you please the compiler invocation for the link step for App? In a typical CMake project I think this would be enabled by adding VERBOSE=1 to your make invocation. |