<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:03:51 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CXX-1768] How to fix undefined reference error when building package with Rcpp and Mongodb</title>
                <link>https://jira.mongodb.org/browse/CXX-1768</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;I&apos;m building an R package that uses Rcpp and needs to work with the mongodb c++ driver. I&apos;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.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;{{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=&quot;C:/Users/colo636/.conan/data/mongo-cxx-driver/3.3.0/bincrafters/stable/package/787d2040e5c5d961041d0db2cb2d77bf26dc9a9a/lib&quot; -Wl,-rpath=&quot;C:/.conan/ed2f7f1/1/optional/lib&quot; -Wl,-rpath=&quot;C:/.conan/3e444eb/1/smart_ptr/lib&quot; -Wl,-rpath=&quot;C:/.conan/63e56dc/1/system/lib&quot; -Wl,-rpath=&quot;C:/Users/colo636/.conan/data/mongo-c-driver/1.11.0/bincrafters/stable/package/656b7d2856e464c5e4f11518a9b153f1852b5edf/lib&quot; -Wl,-rpath=&quot;C:/.conan/2318cdc/1/detail/lib&quot; -Wl,-rpath=&quot;C:/.conan/a2a6117/1/move/lib&quot; -Wl,-rpath=&quot;C:/.conan/53e86f8/1/winapi/lib&quot; -Wl,-rpath=&quot;C:/Users/colo636/.conan/data/zlib/1.2.11/conan/stable/package/425ec5c941593abc5ec9394a8eee44bcaa6409d0/lib&quot; -Wl,-rpath=&quot;C:/.conan/48284bb/1/mpl/lib&quot; -Wl,-rpath=&quot;C:/.conan/ca312fa/1/predef/lib&quot; -Wl,-rpath=&quot;C:/.conan/631754d/1/utility/lib&quot; -Wl,-rpath=&quot;C:/.conan/875bb67/1/preprocessor/lib&quot; -Wl,-rpath=&quot;C:/.conan/c78d9bb/1/type_traits/lib&quot; -Wl,-rpath=&quot;C:/.conan/5d668c3/1/throw_exception/lib&quot; -Wl,-rpath=&quot;C:/.conan/4cf2c0b/1/core/lib&quot; -Wl,-rpath=&quot;C:/.conan/e8e5732/1/static_assert/lib&quot; -Wl,-rpath=&quot;C:/.conan/305ebe9/1/assert/lib&quot; -Wl,-rpath=&quot;C:/.conan/e266456/1/config/lib&quot; -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&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;When I&apos;m coding in a Cpp file in Rstuido, it recognizes the mongo headers and offers suggestions for auto completion when I&apos;m typing. When I try to build the package, I get the error:&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
{{c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o DenovoTagScoring.dll tmp.def RcppExports.o peptide_scoring_w_mass_working_copy.o -LC:/PROGRA~1/R/R-35~1.2/bin/x64 -lR&lt;br/&gt;
peptide_scoring_w_mass_working_copy.o:peptide_scoring_w_mass_working_copy.cpp&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.text+0x210f): undefined reference to `mongocxx::v_noabi::instance::instance()&apos;&lt;br/&gt;
peptide_scoring_w_mass_working_copy.o:peptide_scoring_w_mass_working_copy.cpp&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.text+0x2de7): undefined reference to `mongocxx::v_noabi::instance::~instance()&apos;&lt;br/&gt;
peptide_scoring_w_mass_working_copy.o:peptide_scoring_w_mass_working_copy.cpp&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.text+0x4623): undefined reference to `mongocxx::v_noabi::instance::~instance()&apos;collect2.exe: error: ld returned 1 exit statusno DLL was created&lt;br/&gt;
ERROR: compilation failed for package &apos;DenovoTagScoring&apos;}}&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;This is caused by the code:&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
&lt;tt&gt;mongocxx::instance inst{};&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
After looking online and reading Stack Overflow posts, I think that the compiler isn&apos;t properly linking to the headers I need to use. I don&apos;t know how to fix this issue and would appreciate any help solving this issue. The compiler used to build my package is gcc 4.9.3.&lt;br/&gt;
&#160;&lt;/p&gt;</description>
                <environment>Windows Server2012 R2, Conan Package Manager, gcc</environment>
        <key id="758922">CXX-1768</key>
            <summary>How to fix undefined reference error when building package with Rcpp and Mongodb</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13203">Gone away</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="christian.colon">Christian Colon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 May 2019 17:57:02 +0000</created>
                <updated>Fri, 27 Oct 2023 19:48:16 +0000</updated>
                            <resolved>Thu, 28 Sep 2023 12:53:10 +0000</resolved>
                                    <version>3.3.0</version>
                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5737262" author="JIRAUSER1269924" created="Thu, 28 Sep 2023 12:53:10 +0000"  >&lt;p&gt;Seems to be an issue with RStudio. &lt;/p&gt;</comment>
                            <comment id="2244365" author="kevin.albertson" created="Mon, 13 May 2019 14:45:43 +0000"  >&lt;p&gt;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 &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user mailing list&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stackoverflow&lt;/a&gt; as you will reach a broader audience there.&lt;/p&gt;

&lt;p&gt;If your business requires an answer from MongoDB within a time frame then we do offer &lt;a href=&quot;https://docs.mongodb.com/manual/support/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;production support&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CXX-2634</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6ncn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>