[CXX-1768] How to fix undefined reference error when building package with Rcpp and Mongodb Created: 06/May/19 Updated: 27/Oct/23 Resolved: 28/Sep/23 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | 3.3.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Christian Colon | Assignee: | Unassigned |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server2012 R2, Conan Package Manager, gcc |
||
| Epic Link: | CXX-2634 |
| Description |
|
I'm building an R package that uses Rcpp and needs to work with the mongodb c++ driver. I'm using Windows and installed the mongo c driver(version 1.11.0) and mongo cxx driver (version 3.3.0) through the conan package manager. Using the directions for conan, I build the drivers and use the contents of the generated conanbuildinfo.gcc file for my PKG_CXXFLAGS flag in my Makevars file.
{{PKG_CXXFLAGS = -DBSON_STATIC=1 -DMONGOC_STATIC=1 -DBOOST_ALL_NO_LIB=1 -IC:/Users/colo636/.conan/data/mongo-cxx-driver/3.3.0/bincrafters/stable/package/787d2040e5c5d961041d0db2cb2d77bf26dc9a9a/include -IC:/.conan/ed2f7f1/1/optional/include -IC:/.conan/3e444eb/1/smart_ptr/include -IC:/.conan/63e56dc/1/system/include -IC:/Users/colo636/.conan/data/mongo-c-driver/1.11.0/bincrafters/stable/package/656b7d2856e464c5e4f11518a9b153f1852b5edf/include -IC:/.conan/2318cdc/1/detail/include -IC:/.conan/a2a6117/1/move/include -IC:/.conan/53e86f8/1/winapi/include -IC:/Users/colo636/.conan/data/zlib/1.2.11/conan/stable/package/425ec5c941593abc5ec9394a8eee44bcaa6409d0/include -IC:/.conan/48284bb/1/mpl/include -IC:/.conan/ca312fa/1/predef/include -IC:/.conan/631754d/1/utility/include -IC:/.conan/875bb67/1/preprocessor/include -IC:/.conan/c78d9bb/1/type_traits/include -IC:/.conan/5d668c3/1/throw_exception/include -IC:/.conan/4cf2c0b/1/core/include -IC:/.conan/e8e5732/1/static_assert/include -IC:/.conan/305ebe9/1/assert/include -IC:/.conan/e266456/1/config/include -m64 -O3 -s -DNDEBUG -Wl,-rpath="C:/Users/colo636/.conan/data/mongo-cxx-driver/3.3.0/bincrafters/stable/package/787d2040e5c5d961041d0db2cb2d77bf26dc9a9a/lib" -Wl,-rpath="C:/.conan/ed2f7f1/1/optional/lib" -Wl,-rpath="C:/.conan/3e444eb/1/smart_ptr/lib" -Wl,-rpath="C:/.conan/63e56dc/1/system/lib" -Wl,-rpath="C:/Users/colo636/.conan/data/mongo-c-driver/1.11.0/bincrafters/stable/package/656b7d2856e464c5e4f11518a9b153f1852b5edf/lib" -Wl,-rpath="C:/.conan/2318cdc/1/detail/lib" -Wl,-rpath="C:/.conan/a2a6117/1/move/lib" -Wl,-rpath="C:/.conan/53e86f8/1/winapi/lib" -Wl,-rpath="C:/Users/colo636/.conan/data/zlib/1.2.11/conan/stable/package/425ec5c941593abc5ec9394a8eee44bcaa6409d0/lib" -Wl,-rpath="C:/.conan/48284bb/1/mpl/lib" -Wl,-rpath="C:/.conan/ca312fa/1/predef/lib" -Wl,-rpath="C:/.conan/631754d/1/utility/lib" -Wl,-rpath="C:/.conan/875bb67/1/preprocessor/lib" -Wl,-rpath="C:/.conan/c78d9bb/1/type_traits/lib" -Wl,-rpath="C:/.conan/5d668c3/1/throw_exception/lib" -Wl,-rpath="C:/.conan/4cf2c0b/1/core/lib" -Wl,-rpath="C:/.conan/e8e5732/1/static_assert/lib" -Wl,-rpath="C:/.conan/305ebe9/1/assert/lib" -Wl,-rpath="C:/.conan/e266456/1/config/lib" -LC:/Users/colo636/.conan/data/mongo-cxx-driver/3.3.0/bincrafters/stable/package/787d2040e5c5d961041d0db2cb2d77bf26dc9a9a/lib -LC:/.conan/ed2f7f1/1/optional/lib -LC:/.conan/3e444eb/1/smart_ptr/lib -LC:/.conan/63e56dc/1/system/lib -LC:/Users/colo636/.conan/data/mongo-c-driver/1.11.0/bincrafters/stable/package/656b7d2856e464c5e4f11518a9b153f1852b5edf/lib -LC:/.conan/2318cdc/1/detail/lib -LC:/.conan/a2a6117/1/move/lib -LC:/.conan/53e86f8/1/winapi/lib -LC:/Users/colo636/.conan/data/zlib/1.2.11/conan/stable/package/425ec5c941593abc5ec9394a8eee44bcaa6409d0/lib -LC:/.conan/48284bb/1/mpl/lib -LC:/.conan/ca312fa/1/predef/lib -LC:/.conan/631754d/1/utility/lib -LC:/.conan/875bb67/1/preprocessor/lib -LC:/.conan/c78d9bb/1/type_traits/lib -LC:/.conan/5d668c3/1/throw_exception/lib -LC:/.conan/4cf2c0b/1/core/lib -LC:/.conan/e8e5732/1/static_assert/lib -LC:/.conan/305ebe9/1/assert/lib -LC:/.conan/e266456/1/config/lib -lmongocxx -lbsoncxx -lboost_system -lmongoc-static-1.0 -lbson-static-1.0 -lws2_32.lib -lsecur32.lib -lcrypt32.lib -lBCrypt.lib -lDnsapi.lib -lzlib -D_GLIBCXX_USE_CXX11_ABI=1 When I'm coding in a Cpp file in Rstuido, it recognizes the mongo headers and offers suggestions for auto completion when I'm typing. When I try to build the package, I get the error:
This is caused by the code: |
| Comments |
| Comment by Rishabh Bisht [ 28/Sep/23 ] |
|
Seems to be an issue with RStudio. |
| Comment by Kevin Albertson [ 13/May/19 ] |
|
Thanks for the report! This does not appear to be a bug with the C++ driver. This project is for C++ driver bugs or feature requests. The best place for questions regarding MongoDB usage or C++ driver specifics is the mongodb-user mailing list or stackoverflow as you will reach a broader audience there. If your business requires an answer from MongoDB within a time frame then we do offer production support. |