<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:04:06 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-1846] mongocxx::uri call works with c char* parameter but not with c++ string parameter</title>
                <link>https://jira.mongodb.org/browse/CXX-1846</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Hi All,&lt;/p&gt;

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

&lt;p&gt;If I simply call this function:&lt;/p&gt;

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

&lt;p&gt;mongocxx::uri uri = mongocxx::uri(ServerSetup::mongoUri().c_str());&lt;/p&gt;

&lt;p&gt;with C type char* parameter like above, it works, but if I call it with a c++ type string like this:&lt;/p&gt;

&lt;p&gt;mongocxx::uri uri = mongocxx::uri(ServerSetup::mongoUri());&lt;/p&gt;

&lt;p&gt;then it crashes with null pointer. See the message in file attachment.&lt;/p&gt;

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

&lt;p&gt;My full code is the following:&lt;/p&gt;

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

&lt;p&gt;#include &amp;lt;cstdint&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;iostream&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;vector&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;string&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;mongocxx/instance.hpp&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;bsoncxx/json.hpp&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;bsoncxx/string/view_or_value.hpp&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;mongocxx/client.hpp&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;mongocxx/collection.hpp&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;mongocxx/stdx.hpp&amp;gt;&lt;/p&gt;

&lt;p&gt;#include &amp;lt;mongocxx/uri.hpp&amp;gt;&lt;/p&gt;



&lt;p&gt;class ServerSetup&lt;/p&gt;

{
 
public:
 
 const static std::string&amp;amp; mongoUri();
 
 
 
private:
 
 static std::string MongoUri;
 
}
&lt;p&gt;;&lt;/p&gt;


&lt;p&gt;//Of course the real url would be different, not &quot;my_server&quot;, but I can&apos;t share the company url with you&lt;br/&gt;
std::string ServerSetup::MongoUri = &quot;mongodb://my_server/?ssl=true&quot;;&lt;/p&gt;



&lt;p&gt;const std::string&amp;amp; ServerSetup::mongoUri()&lt;/p&gt;

{ return MongoUri; }



&lt;p&gt;int main()&lt;/p&gt;

&lt;p&gt;{ &lt;/p&gt;

&lt;p&gt; try&lt;/p&gt;

&lt;p&gt; {&lt;/p&gt;

&lt;p&gt; mongocxx::instance instance{};&lt;/p&gt;

&lt;p&gt; mongocxx::uri uri = mongocxx::uri(ServerSetup::mongoUri());&lt;/p&gt;

&lt;p&gt; }&lt;/p&gt;

&lt;p&gt; catch (std::exception&amp;amp; ex)&lt;/p&gt;

 {
 
 std::cout &amp;lt;&amp;lt; &quot;std::excetpion caught: &quot; &amp;lt;&amp;lt; ex.what();
 
 }

&lt;p&gt; catch (...)&lt;/p&gt;

 {
 
 std::cout &amp;lt;&amp;lt; &quot;unknown excetpion caught&quot;;
 
 }

&lt;p&gt; return 0;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;It doesn&apos;t seem to be correct.&lt;br/&gt;
(It doesn&apos;t work with either non-static string parameter, but I then I got an exception, like &quot;an invalid MongoDB URI was provided&quot;. But the non-static string was working if I convert it with c_str() as above.)&lt;br/&gt;
Please me with this issue.&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Bal&#225;zs&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Windows</environment>
        <key id="971088">CXX-1846</key>
            <summary>mongocxx::uri call works with c char* parameter but not with c++ string parameter</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="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="balazs.gerjak@citi.com">Bal&#225;zs Gerj&#225;k</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Oct 2019 14:14:10 +0000</created>
                <updated>Fri, 27 Oct 2023 19:48:17 +0000</updated>
                            <resolved>Mon, 2 Mar 2020 15:39:59 +0000</resolved>
                                    <version>3.4.0</version>
                                                    <component>Implementation</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2922869" author="april.schoffer" created="Mon, 2 Mar 2020 15:39:59 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=balazs.gerjak%40citi.com&quot; class=&quot;user-hover&quot; rel=&quot;balazs.gerjak@citi.com&quot;&gt;balazs.gerjak@citi.com&lt;/a&gt; closing this ticket. Thank you for reaching out.&#160;&lt;/p&gt;</comment>
                            <comment id="2856202" author="kevin.albertson" created="Mon, 10 Feb 2020 15:05:48 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=balazs.gerjak%40citi.com&quot; class=&quot;user-hover&quot; rel=&quot;balazs.gerjak@citi.com&quot;&gt;balazs.gerjak@citi.com&lt;/a&gt;, apologies for the late reply.&lt;/p&gt;

&lt;p&gt;It&apos;s possible that your application and it&apos;s dependents are linked to different forms of Windows runtime libraries, causing the runtime crash. It may be helpful to inspect the output of &lt;tt&gt;dumpbin.exe&lt;/tt&gt; to check that your application, the C driver, Boost, and C++ driver, all use the same CRT.&#160; Using the&#160;native tools command prompt for VS 2015 for example:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;dumpbin.exe /DEPENDENTS libmongoc-&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;.dll&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Best,&lt;br/&gt;
Kevin&lt;/p&gt;</comment>
                            <comment id="2506232" author="balazs.gerjak@citi.com" created="Tue, 29 Oct 2019 11:05:25 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Thank you for your help! Sadly we still have issues.&lt;/p&gt;

&lt;p&gt;I start with the most important thing.&lt;br/&gt;
The final error what we got with the example code is an assertion failed.&lt;br/&gt;
See attached picture by the name of assertionErrorWithExampleCode.png.&lt;/p&gt;


&lt;p&gt;About the compilation of the example you provided:&lt;br/&gt;
--------------------------------------------------&lt;br/&gt;
With your code I have a few problem at the mongo-c compilation step:&lt;br/&gt;
1, Which cmake do you use? (3.5.2?) For me I have to explicitely tell it to the command prompt, &lt;br/&gt;
while you get it from the environment, but I guess it won&apos;t be a problem.&lt;br/&gt;
2, You have set a few environment variable I guess, because you do not need to add the Windows Kit either to&lt;br/&gt;
the PATH. For us, if I do not set it I get an error message thet compiler not found. &lt;br/&gt;
(See attached compilerError.png).&lt;/p&gt;

&lt;p&gt;It is not a big thing, but still a difference, so I can&apos;t reproduce your exact steps.&lt;/p&gt;

&lt;p&gt;A bigger problem occures during the compilation of the &lt;a href=&quot;https://github.com/kevinAlbs/CXX-1846.git&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/kevinAlbs/CXX-1846.git&lt;/a&gt; &lt;br/&gt;
example code. As before I guess you set a few environment variables.&lt;br/&gt;
I had to set the BOOST_ROOT to the boost root directory or it couldn&apos;t compile but even &lt;br/&gt;
after that I had the following error with your CMakeList.txt file:&lt;/p&gt;

&lt;p&gt;C:\MyStuff\mongoProba\source\&lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1846&quot; title=&quot;mongocxx::uri call works with c char* parameter but not with c++ string parameter&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1846&quot;&gt;&lt;del&gt;CXX-1846&lt;/del&gt;&lt;/a&gt;-master\cmake-build&amp;gt;I:\vendor-tools\cmake_3_5_2\bin\cmake -G &quot;Visual Studio 14 2015 Win64&quot; -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:\mongo-cxx-driver ..&lt;br/&gt;
&amp;#8211; The C compiler identification is MSVC 19.0.24234.1&lt;br/&gt;
&amp;#8211; The CXX compiler identification is MSVC 19.0.24234.1&lt;br/&gt;
&amp;#8211; Check for working C compiler using: Visual Studio 14 2015 Win64&lt;br/&gt;
&amp;#8211; Check for working C compiler using: Visual Studio 14 2015 Win64 &amp;#8211; works&lt;br/&gt;
&amp;#8211; Detecting C compiler ABI info&lt;br/&gt;
&amp;#8211; Detecting C compiler ABI info - done&lt;br/&gt;
&amp;#8211; Check for working CXX compiler using: Visual Studio 14 2015 Win64&lt;br/&gt;
&amp;#8211; Check for working CXX compiler using: Visual Studio 14 2015 Win64 &amp;#8211; works&lt;br/&gt;
&amp;#8211; Detecting CXX compiler ABI info&lt;br/&gt;
&amp;#8211; Detecting CXX compiler ABI info - done&lt;br/&gt;
&amp;#8211; Detecting CXX compile features&lt;br/&gt;
&amp;#8211; Detecting CXX compile features - done&lt;br/&gt;
&amp;#8211; Boost version: 1.60.0&lt;br/&gt;
&amp;#8211; Configuring done&lt;br/&gt;
CMake Warning (dev) at CMakeLists.txt:2 (add_executable):&lt;br/&gt;
 Policy CMP0028 is not set: Double colon in target name means ALIAS or&lt;br/&gt;
 IMPORTED target. Run &quot;cmake --help-policy CMP0028&quot; for policy details.&lt;br/&gt;
 Use the cmake_policy command to set the policy and suppress this warning.&lt;/p&gt;

&lt;p&gt;Target &quot;repro&quot; links to target &quot;Boost::boost&quot; but the target was not found.&lt;br/&gt;
 Perhaps a find_package() call is missing for an IMPORTED target, or an&lt;br/&gt;
 ALIAS target is missing?&lt;br/&gt;
This warning is for project developers. Use -Wno-dev to suppress it.&lt;/p&gt;

&lt;p&gt;CMake Warning (dev) at CMakeLists.txt:2 (add_executable):&lt;br/&gt;
 Policy CMP0028 is not set: Double colon in target name means ALIAS or&lt;br/&gt;
 IMPORTED target. Run &quot;cmake --help-policy CMP0028&quot; for policy details.&lt;br/&gt;
 Use the cmake_policy command to set the policy and suppress this warning.&lt;/p&gt;

&lt;p&gt;Target &quot;repro&quot; links to target &quot;Boost::boost&quot; but the target was not found.&lt;br/&gt;
 Perhaps a find_package() call is missing for an IMPORTED target, or an&lt;br/&gt;
 ALIAS target is missing?&lt;br/&gt;
This warning is for project developers. Use -Wno-dev to suppress it.&lt;/p&gt;

&lt;p&gt;CMake Warning (dev) at CMakeLists.txt:2 (add_executable):&lt;br/&gt;
 Policy CMP0028 is not set: Double colon in target name means ALIAS or&lt;br/&gt;
 IMPORTED target. Run &quot;cmake --help-policy CMP0028&quot; for policy details.&lt;br/&gt;
 Use the cmake_policy command to set the policy and suppress this warning.&lt;/p&gt;

&lt;p&gt;Target &quot;repro&quot; links to target &quot;Boost::boost&quot; but the target was not found.&lt;br/&gt;
 Perhaps a find_package() call is missing for an IMPORTED target, or an&lt;br/&gt;
 ALIAS target is missing?&lt;br/&gt;
This warning is for project developers. Use -Wno-dev to suppress it.&lt;/p&gt;

&lt;p&gt;CMake Warning (dev) at CMakeLists.txt:2 (add_executable):&lt;br/&gt;
 Policy CMP0028 is not set: Double colon in target name means ALIAS or&lt;br/&gt;
 IMPORTED target. Run &quot;cmake --help-policy CMP0028&quot; for policy details.&lt;br/&gt;
 Use the cmake_policy command to set the policy and suppress this warning.&lt;/p&gt;

&lt;p&gt;Target &quot;repro&quot; links to target &quot;Boost::boost&quot; but the target was not found.&lt;br/&gt;
 Perhaps a find_package() call is missing for an IMPORTED target, or an&lt;br/&gt;
 ALIAS target is missing?&lt;br/&gt;
This warning is for project developers. Use -Wno-dev to suppress it.&lt;/p&gt;

&lt;p&gt;CMake Warning (dev) at CMakeLists.txt:2 (add_executable):&lt;br/&gt;
 Policy CMP0028 is not set: Double colon in target name means ALIAS or&lt;br/&gt;
 IMPORTED target. Run &quot;cmake --help-policy CMP0028&quot; for policy details.&lt;br/&gt;
 Use the cmake_policy command to set the policy and suppress this warning.&lt;/p&gt;

&lt;p&gt;Target &quot;repro&quot; links to target &quot;Boost::boost&quot; but the target was not found.&lt;br/&gt;
 Perhaps a find_package() call is missing for an IMPORTED target, or an&lt;br/&gt;
 ALIAS target is missing?&lt;br/&gt;
This warning is for project developers. Use -Wno-dev to suppress it.&lt;/p&gt;

&lt;p&gt;&amp;#8211; Generating done&lt;br/&gt;
CMake Warning:&lt;br/&gt;
 Manually-specified variables were not used by the project:&lt;/p&gt;

&lt;p&gt;CMAKE_BUILD_TYPE&lt;/p&gt;

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

&lt;p&gt;&amp;#8211; Build files have been written to: C:/MyStuff/mongoProba/source/&lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1846&quot; title=&quot;mongocxx::uri call works with c char* parameter but not with c++ string parameter&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1846&quot;&gt;&lt;del&gt;CXX-1846&lt;/del&gt;&lt;/a&gt;-master/cmake-build&lt;/p&gt;

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

&lt;p&gt;Can you help us how you did it exactly?&lt;/p&gt;

&lt;p&gt;Thank you in advance,&lt;br/&gt;
Bal&#225;zs&lt;/p&gt;

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

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/235505/235505_assertionErrorWithExampleCode.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;235506_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/235506/235506_compilerError.png&quot; title=&quot;compilerError.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;235506&quot; file-preview-title=&quot;compilerError.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/235506/_thumb_235506.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="2501827" author="kevin.albertson" created="Fri, 25 Oct 2019 21:23:43 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=balazs.gerjak%40citi.com&quot; class=&quot;user-hover&quot; rel=&quot;balazs.gerjak@citi.com&quot;&gt;balazs.gerjak@citi.com&lt;/a&gt;. Looking at the code you&apos;ve provided, nothing strikes me as odd. So I&apos;ve attempted to reproduce this using a Visual Studio 2015 compiler, with steps resembling the ones you posted to no avail. I&apos;ve described the steps, and included source code in this repository: &lt;a href=&quot;https://github.com/kevinAlbs/CXX-1846&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/kevinAlbs/CXX-1846&lt;/a&gt;. They&apos;re copied here:&lt;/p&gt;

&lt;p&gt;Open VS2015 x64 Native Tools Command Prompt.&lt;/p&gt;

&lt;p&gt;Build C driver&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd C:/source&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; git clone --branch 1.15.1 https://github.com/mongodb/mongo-c-driver.git&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd mongo-c-driver&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; mkdir cmake-build&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd cmake-build&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cmake.exe -G &quot;Visual Studio 14 2015 Win64&quot; -DCMAKE_BUILD_TYPE=Release -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver ..&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; msbuild.exe /m INSTALL.vcxproj&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Build C++ driver&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd C:/source&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; git clone --branch r3.4.0 https://github.com/mongodb/mongo-cxx-driver.git&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd mongo-cxx-driver&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; mkdir cmake-build&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd cmake-build&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cmake -G &quot;Visual Studio 14 2015 Win64&quot; -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver -DCMAKE_PREFIX_PATH=C:\mongo-c-driver -DBOOST_ROOT=C:\boost_1_60_0 ..&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; msbuild.exe /m INSTALL.vcxproj&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Build the repro&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd C:/source&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; git clone https://github.com/kevinAlbs/CXX-1846.git&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; mkdir cmake-build&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cd cmake-build&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; cmake -G &quot;Visual Studio 14 2015 Win64&quot; -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:\mongo-cxx-driver ..&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Add C:\mongo-c-driver\bin and C:\mongo-cxx-driver\bin to PATH. Then run.&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; .\Debug\repro.exe&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongodb://my_server/?ssl=true&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;This printed the URI and did not reproduce the issue. If you have any additional information to provide, please do. If you can reproduce with a debug build (of the repro, C++ driver, and C driver) perhaps stepping through with Visual Studio&apos;s debugger may provide additional information. But I currently do not believe this is a bug with the C++ driver.&lt;/p&gt;</comment>
                            <comment id="2494172" author="balazs.gerjak@citi.com" created="Tue, 22 Oct 2019 09:18:15 +0000"  >&lt;p&gt;Hi Clyde,&lt;/p&gt;

&lt;p&gt;I updated the issue with comments.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Bal&#225;zs&lt;/p&gt;

&lt;p&gt;From: &lt;span class=&quot;error&quot;&gt;&amp;#91;External&amp;#93;&lt;/span&gt; Clyde Bazile (Jira) &amp;lt;jira@mongodb.org&amp;gt;&lt;br/&gt;
Sent: Monday, October 21, 2019 6:28 PM&lt;br/&gt;
To: Gerjak, Balazs &lt;span class=&quot;error&quot;&gt;&amp;#91;CCC-OT&amp;#93;&lt;/span&gt;&lt;br/&gt;
Subject: &lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB-JIRA&amp;#93;&lt;/span&gt; (&lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1846&quot; title=&quot;mongocxx::uri call works with c char* parameter but not with c++ string parameter&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1846&quot;&gt;&lt;del&gt;CXX-1846&lt;/del&gt;&lt;/a&gt;) mongocxx::uri call works with c char* parameter but not with c++ string parameter&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Image removed by sender.&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;cid:image001.png@01D588C7.288916C0&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Clyde Bazile&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_secure_ViewProfile.jspa-3Fname-3Dclyde.bazile&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=9Isjbsgpr9w0IbR9V4IbCnlo9gXIP2siAzZPsuXFh1k&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_secure_ViewProfile.jspa-3Fname-3Dclyde.bazile&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=9Isjbsgpr9w0IbR9V4IbCnlo9gXIP2siAzZPsuXFh1k&amp;amp;e=&lt;/a&gt;&amp;gt; commented on &lt;span class=&quot;error&quot;&gt;&amp;#91;Bug&amp;#93;&lt;/span&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1846&quot; title=&quot;mongocxx::uri call works with c char* parameter but not with c++ string parameter&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1846&quot;&gt;&lt;del&gt;CXX-1846&lt;/del&gt;&lt;/a&gt;&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=m4URAG722Mf1Y0uqUi-bgvy8IOGSbMD1d7awuLuxFDc&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=m4URAG722Mf1Y0uqUi-bgvy8IOGSbMD1d7awuLuxFDc&amp;amp;e=&lt;/a&gt;&amp;gt;&lt;/p&gt;




&lt;p&gt;Re: mongocxx::uri call works with c char* parameter but not with c++ string parameter&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=m4URAG722Mf1Y0uqUi-bgvy8IOGSbMD1d7awuLuxFDc&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=m4URAG722Mf1Y0uqUi-bgvy8IOGSbMD1d7awuLuxFDc&amp;amp;e=&lt;/a&gt;&amp;gt;&lt;/p&gt;



&lt;p&gt;Hi Bal&#225;zs Gerj&#225;k&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_secure_ViewProfile.jspa-3Fname-3Dbalazs.gerjak-2540citi.com&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=aZ1pHuILPxJlWoZxmltDke7-C0iyAlc-bvQTi-Lnr2o&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_secure_ViewProfile.jspa-3Fname-3Dbalazs.gerjak-2540citi.com&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=aZ1pHuILPxJlWoZxmltDke7-C0iyAlc-bvQTi-Lnr2o&amp;amp;e=&lt;/a&gt;&amp;gt;, thanks for bringing this to our attention. Unfortunately, I can not reproduce the errors you described locally. The following code, which you provided, compiles without issue and prints out the given URI:&lt;/p&gt;

&lt;p&gt;class ServerSetup &lt;/p&gt;
{


    public:


        const static std::string&amp;amp; mongoUri();


    private:


        static std::string MongoUri;


}
&lt;p&gt;;&lt;/p&gt;


&lt;p&gt;std::string ServerSetup::MongoUri = &quot;mongodb://my_server/?ssl=true&quot;;&lt;/p&gt;


&lt;p&gt;const std::string&amp;amp; ServerSetup::mongoUri() &lt;/p&gt;
{


    return MongoUri;


}


&lt;p&gt;int main() {&lt;/p&gt;


&lt;p&gt;    try {&lt;/p&gt;


&lt;p&gt;        mongocxx::instance instance{};&lt;/p&gt;


&lt;p&gt;        mongocxx::uri uri = mongocxx::uri(ServerSetup::mongoUri());&lt;/p&gt;


&lt;p&gt;        std::cout &amp;lt;&amp;lt; uri.to_string() &amp;lt;&amp;lt; std::endl;&lt;/p&gt;


&lt;p&gt;    } catch (std::exception&amp;amp; ex) &lt;/p&gt;
{


        std::cout &amp;lt;&amp;lt; &quot;std::excetpion caught: &quot; &amp;lt;&amp;lt; ex.what();


    }


&lt;p&gt;    return 0;&lt;/p&gt;


&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;The mongocxx::uri::uri&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=http-3A__mongocxx.org_api_mongocxx-2Dv3_classmongocxx-5F1-5F1uri.html-23aa9b5e381b627462ce75f11e549b3bfe2&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=wXPr_kyLTjN4XFBO1fOO347TJLjxPXSyJD2tbqEW3bg&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=http-3A__mongocxx.org_api_mongocxx-2Dv3_classmongocxx-5F1-5F1uri.html-23aa9b5e381b627462ce75f11e549b3bfe2&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=wXPr_kyLTjN4XFBO1fOO347TJLjxPXSyJD2tbqEW3bg&amp;amp;e=&lt;/a&gt;&amp;gt; method take a string::view_or_value&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=http-3A__mongocxx.org_api_mongocxx-2Dv3_classbsoncxx-5F1-5F1string-5F1-5F1view-5F-5For-5F-5Fvalue.html-23ac36599835455b274481c71528bd494cb&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=hz2_cNYrhU9j8wpHn03dvSZOqYxw2VfKgVLVP1G98Ac&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=http-3A__mongocxx.org_api_mongocxx-2Dv3_classbsoncxx-5F1-5F1string-5F1-5F1view-5F-5For-5F-5Fvalue.html-23ac36599835455b274481c71528bd494cb&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=hz2_cNYrhU9j8wpHn03dvSZOqYxw2VfKgVLVP1G98Ac&amp;amp;e=&lt;/a&gt;&amp;gt; which can be constructed using either a const char ** or a *const std::string&amp;amp;. Perhaps ensuring that the connection string&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.mongodb.com_manual_reference_connection-2Dstring_index.html-23standard-2Dconnection-2Dstring-2Dformat&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=aXxGI7zQS9G4tAUr9Be0Ui7f9ibPTHEtj3khDCj_kr8&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.mongodb.com_manual_reference_connection-2Dstring_index.html-23standard-2Dconnection-2Dstring-2Dformat&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=aXxGI7zQS9G4tAUr9Be0Ui7f9ibPTHEtj3khDCj_kr8&amp;amp;e=&lt;/a&gt;&amp;gt; URI you provided is correctly formated may help.&lt;/p&gt;




&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Add Comment&amp;#93;&lt;/span&gt;&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846-23add-2Dcomment&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=11F7xUbkxaHErHz9IP4uFKMkaDLkNaq9vBRlsSkrxtg&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846-23add-2Dcomment&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=11F7xUbkxaHErHz9IP4uFKMkaDLkNaq9vBRlsSkrxtg&amp;amp;e=&lt;/a&gt;&amp;gt;&lt;/p&gt;

&lt;p&gt;Add Comment&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846-23add-2Dcomment&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=11F7xUbkxaHErHz9IP4uFKMkaDLkNaq9vBRlsSkrxtg&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org_browse_CXX-2D1846-23add-2Dcomment&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=11F7xUbkxaHErHz9IP4uFKMkaDLkNaq9vBRlsSkrxtg&amp;amp;e=&lt;/a&gt;&amp;gt;&lt;/p&gt;






&lt;p&gt;This message was sent from MongoDB&apos;s issue tracking system. To respond to this ticket, please login to jira.mongodb.org&amp;lt;&lt;a href=&quot;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=YIdM4M2QG5MgfhtP_iOCElWqUGTfg-LfaJphfo0wsuw&amp;amp;e=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://urldefense.proofpoint.com/v2/url?u=https-3A__jira.mongodb.org&amp;amp;d=DwMFaQ&amp;amp;c=j-EkbjBYwkAB4f8ZbVn1Fw&amp;amp;r=kMhjQW60do6qv1ixqr1c8IginFoyTxWfQzO_XSWOU6I&amp;amp;m=WQWV7of2HpKvXEM8XbpOEc5NxP92XKz92N_eH8HFGkk&amp;amp;s=YIdM4M2QG5MgfhtP_iOCElWqUGTfg-LfaJphfo0wsuw&amp;amp;e=&lt;/a&gt;&amp;gt; using your JIRA, MongoDB Cloud Manager, or MongoDB Atlas credentials.&lt;/p&gt;</comment>
                            <comment id="2494151" author="balazs.gerjak@citi.com" created="Tue, 22 Oct 2019 08:50:29 +0000"  >&lt;p&gt;Hi Clyde,&lt;/p&gt;

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

&lt;p&gt;We know about that&#160;&#160;string::view_or_value&#160;can be constructed with const char* or const std::string&amp;amp; parameter.&lt;/p&gt;

&lt;p&gt;That is why I wrote that it works with&#160;const char*, but we got an error with&#160;const std::string&amp;amp; parameter.&lt;/p&gt;

&lt;p&gt;Also it is working on Linux, but not on Windows. So I think the connection string is correctly formatted or else it wouldn&apos;t work in these cases either.&lt;/p&gt;

&lt;p&gt;For the error to occure, I think you should use our compiler:&lt;br/&gt;
-------------------------------------------------------------&lt;br/&gt;
We used the compiler from Visual Studio 2015 with cmake 3.5.2.&lt;/p&gt;

&lt;p&gt;(Microsoft Visual Studio Professional 2015&lt;br/&gt;
Version 14.0.25431.01 Update 3&lt;br/&gt;
Microsoft .NET Framework&lt;br/&gt;
Version 4.7.02556)&lt;/p&gt;


&lt;p&gt;For mongo-c compilation:&lt;br/&gt;
------------------------&lt;br/&gt;
cmake -G &quot;Visual Studio 14 2015 Win64&quot; -DBUILD_VERSION=1.14.0 -DCMAKE_BUILD_TYPE=Release &lt;br/&gt;
-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DCMAKE_INSTALL_PREFIX=I:\mongo-c-driver &lt;br/&gt;
-DCMAKE_PREFIX_PATH=I:\mongo-c-driver ..&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;msbuild.exe INSTALL.vcxproj&lt;/p&gt;


&lt;p&gt;For mongo-cxx compilation:&lt;br/&gt;
--------------------------&lt;br/&gt;
cmake -G &quot;Visual Studio 14 2015 Win64&quot; -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=I:\mongo-cxx-driver &lt;br/&gt;
-DCMAKE_PREFIX_PATH=I:\mongo-c-driver -DBOOST_ROOT=I:\boost_1_60_0 ..&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;msbuild.exe ALL_BUILD.vcxproj&lt;br/&gt;
msbuild.exe INSTALL.vcxproj&lt;/p&gt;</comment>
                            <comment id="2492896" author="clyde.bazile" created="Mon, 21 Oct 2019 16:27:59 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=balazs.gerjak%40citi.com&quot; class=&quot;user-hover&quot; rel=&quot;balazs.gerjak@citi.com&quot;&gt;balazs.gerjak@citi.com&lt;/a&gt;, thanks for bringing this to our attention. Unfortunately, I can not reproduce the errors you described locally. The following code, which you provided, compiles without issue and prints out the given URI:&#160;&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; ServerSetup {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;:&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; std::string&amp;amp; mongoUri();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;:&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; std::string MongoUri;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;};&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;std::string ServerSetup::MongoUri = &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;mongodb://my_server/?ssl=true&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; std::string&amp;amp; ServerSetup::mongoUri() {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; MongoUri;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; main() {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        mongocxx::instance instance{};&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        mongocxx::uri uri = mongocxx::uri(ServerSetup::mongoUri());&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        std::cout &amp;lt;&amp;lt; uri.to_string() &amp;lt;&amp;lt; std::endl;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; (std::exception&amp;amp; ex) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        std::cout &amp;lt;&amp;lt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;std::excetpion caught: &quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; &amp;lt;&amp;lt; ex.what();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; 0;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;The &lt;a href=&quot;http://mongocxx.org/api/mongocxx-v3/classmongocxx_1_1uri.html#aa9b5e381b627462ce75f11e549b3bfe2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongocxx::uri::uri&lt;/a&gt; method take a&#160;&lt;a href=&quot;http://mongocxx.org/api/mongocxx-v3/classbsoncxx_1_1string_1_1view__or__value.html#ac36599835455b274481c71528bd494cb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;string::view_or_value&lt;/a&gt; which can be constructed using either a &lt;em&gt;const char *&lt;/em&gt; or a &lt;em&gt;const std::string&amp;amp;&lt;/em&gt;. Perhaps ensuring that the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/connection-string/index.html#standard-connection-string-format&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;connection string&lt;/a&gt; URI you provided is correctly formated may help.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="235505" name="assertionErrorWithExampleCode.png" size="16095" author="balazs.gerjak@citi.com" created="Tue, 29 Oct 2019 11:04:49 +0000"/>
                            <attachment id="235506" name="compilerError.png" size="46471" author="balazs.gerjak@citi.com" created="Tue, 29 Oct 2019 11:04:50 +0000"/>
                            <attachment id="234483" name="image003.png" size="645" author="balazs.gerjak@citi.com" created="Tue, 22 Oct 2019 09:18:15 +0000"/>
                            <attachment id="233898" name="mongoUriError.png" size="16212" author="balazs.gerjak@citi.com" created="Wed, 16 Oct 2019 14:14:05 +0000"/>
                            <attachment id="234482" name="~WRD000.jpg" size="823" author="balazs.gerjak@citi.com" created="Tue, 22 Oct 2019 09:18:15 +0000"/>
                    </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvm7k7:</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>