<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:58:42 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-266] Driver won&apos;t compile on Windows with cl.exe (MSVC compiler)</title>
                <link>https://jira.mongodb.org/browse/CXX-266</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Not sure if anyone tried compiling it with Microsoft Visual Studio C++ (I use most recent 2013 build), but it won&apos;t compile due to a problem with certain windows headers.&lt;/p&gt;

&lt;p&gt;I tracked it down to two cases - one where mongo/platform/process_id.h fails because certain file that includes it doesn&apos;t also include &quot;mongo/platform/basic.h&quot; which in turn includes required windows headers (it lacks definition of DWORD). Another problem is with net/sock.h which, on the other hand, misses definition of sockaddr.&lt;/p&gt;

&lt;p&gt;It seems that only certain .cpp files include &quot;mongo/platform/basic.h&quot; and its not enough. I solved it temporarily by just including this file in both, process_id.h and sock.h. Not sure what the intentions were, but either its basic and should be included in every file, or its selectively included in files that need it, but then it seems quite a lot of files were omitted - almost every file compiled throws an error because it either lacks DWORD def or sockaddr.&lt;/p&gt;

&lt;p&gt;I attached compiler error.&lt;/p&gt;</description>
                <environment></environment>
        <key id="144516">CXX-266</key>
            <summary>Driver won&apos;t compile on Windows with cl.exe (MSVC compiler)</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="9">Done</resolution>
                                        <assignee username="tyler@10gen.com">Tyler Brock</assignee>
                                    <reporter username="noizex">Kamil N</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Sun, 29 Jun 2014 21:05:23 +0000</created>
                <updated>Tue, 8 Jul 2014 15:25:56 +0000</updated>
                            <resolved>Mon, 7 Jul 2014 16:56:32 +0000</resolved>
                                    <version>legacy-0.10.0</version>
                                    <fixVersion>legacy-0.11.0</fixVersion>
                                    <component>Build</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="650571" author="tyler@10gen.com" created="Mon, 7 Jul 2014 16:56:20 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/pull/117&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/pull/117&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="650569" author="tyler@10gen.com" created="Mon, 7 Jul 2014 16:55:46 +0000"  >&lt;p&gt;Kamil, would you mind confirming that the driver compiles now for you using the current legacy branch of the driver?&lt;/p&gt;</comment>
                            <comment id="650560" author="xgen-internal-githook" created="Mon, 7 Jul 2014 16:50:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;TylerBrock&apos;, u&apos;name&apos;: u&apos;Tyler Brock&apos;, u&apos;email&apos;: u&apos;tyler.brock@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-266&quot; title=&quot;Driver won&amp;#39;t compile on Windows with cl.exe (MSVC compiler)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-266&quot;&gt;&lt;del&gt;CXX-266&lt;/del&gt;&lt;/a&gt; ensure basic.h is included where needed&lt;br/&gt;
Branch: legacy&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/6b6d83a3bb7b7c32dd135056d1468f9c2507d034&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/6b6d83a3bb7b7c32dd135056d1468f9c2507d034&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="646010" author="acm" created="Wed, 2 Jul 2014 15:44:09 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=noizex&quot; class=&quot;user-hover&quot; rel=&quot;noizex&quot;&gt;noizex&lt;/a&gt; See this file for a correctly formatted inclusion of basic.h: &lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/blob/legacy/src/mongo/client/bulk_operation_builder.cpp&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/blob/legacy/src/mongo/client/bulk_operation_builder.cpp&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="646005" author="acm" created="Wed, 2 Jul 2014 15:42:40 +0000"  >&lt;p&gt;Hi @Kamil N -&lt;/p&gt;

&lt;p&gt;Yes, adding basic.h as the first include as necessary is the correct resolution. Are you willing to put together a pull request containing your fixes? If so, please read our contributors guide and sign the contributors agreement if you have not already done so.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;</comment>
                            <comment id="640833" author="noizex" created="Tue, 1 Jul 2014 17:59:47 +0000"  >&lt;p&gt;Ok, I attached sock.h errors file. I just copied 3 cases there, but the same error persists in other files. I wasn&apos;t sure what would be the best solution so I just did dirty hack with including basic.h inside sock.h file instead of including it in each of .cpp files, but there is at least 10 of them.&lt;/p&gt;

&lt;p&gt;If you can confirm that thats what should be done (just putting basic.h as first include in each affected file) then its easily solved, and I encountered no other errors. &lt;/p&gt;

&lt;p&gt;May be that older versions of MSVC somehow append winsock.h / windows.h by default, or supply these headers in other way, and on MSVC2013 its just not there until its included by user.&lt;/p&gt;</comment>
                            <comment id="640652" author="acm" created="Tue, 1 Jul 2014 15:36:44 +0000"  >&lt;p&gt;Thanks. The rule is that it is always safe to add basic.h to .cpp files (always as the first include, followed by a blank line, then system headers, then mongo headers), and it should never be added to .h files.&lt;/p&gt;</comment>
                            <comment id="640640" author="noizex" created="Tue, 1 Jul 2014 15:29:07 +0000"  >&lt;p&gt;Sure, I will post them once I get back home. I think the sock.h issue was more severe in terms of number of files affected, I think without copy&amp;amp;pasting &quot;#include basic.h&quot; to each .cpp file, there was an error. I stopped after few files and just added this include to the sock.h itself if I remember well. I will confirm it later when I post error logs.&lt;/p&gt;</comment>
                            <comment id="640631" author="acm" created="Tue, 1 Jul 2014 15:23:24 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=noizex&quot; class=&quot;user-hover&quot; rel=&quot;noizex&quot;&gt;noizex&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;RE the process_id issue: the issue is that oid.cpp needs to include basic.h. Can you post the error that you get re sock.h?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;</comment>
                            <comment id="640616" author="acm" created="Tue, 1 Jul 2014 15:12:07 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=noizex&quot; class=&quot;user-hover&quot; rel=&quot;noizex&quot;&gt;noizex&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for the bug report. We do currently do automated builds with MSVC, but I think with 2010.&lt;/p&gt;

&lt;p&gt;I think you are correct that process_id.h needs basic.h.&lt;/p&gt;

&lt;p&gt;Also, it looks like process_id.h is currently staged to the $PREFIX/include directory, despite no other public headers including it.&lt;/p&gt;

&lt;p&gt;We will try to get to this in the next release, or if you want to put together a pull request we will work with you to get it merged.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="46655" name="error.txt" size="5580" author="noizex" created="Sun, 29 Jun 2014 21:05:23 +0000"/>
                            <attachment id="46808" name="sock_h_error.txt" size="8474" author="noizex" created="Tue, 1 Jul 2014 17:55:27 +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|hs03i7:</customfieldvalue>

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