<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Quite frankly, I don't know the standard way. My way to tackle this
    problem is to add config.make to the <br>
    module like this:<br>
    <br>
    ========================================================<br>
    <br>
    cat config.make <br>
    find $ngx_addon_dir -name "*.cc" -print |<br>
        while read x; do<br>
            x=$(basename $x | sed 's/\.cc//')<br>
            cat << __END__ >> $NGX_MAKEFILE<br>
    objs/addon/mymodule/$x.o: CFLAGS += -std=c++11<br>
    <br>
    __END__<br>
        done<br>
    =========================================================<br>
    <br>
    <br>
    It is to change CFLAGS just for those *.cc of the module in
    question, the CFLAGS for other *.c does<br>
    not change. Of course, you need to add -lstdc++ to the lib.<br>
    <br>
    <br>
    This topic was discussed before, IIRC someone suggested to configure
    nginx with C++ compiler instead <br>
    of C compiler. It does not work for me for at least two reasons:<br>
    <br>
       - there are too many warnings (e.g. c++ compiler is not happy
    with the implicit cast from void* to some-type*)<br>
       - cannot pass c++ specific flags<br>
    <br>
    <br>
    Thanks<br>
    Shuxin    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 06/15/2016 08:27 AM, Rajalakshmi
      Iyer wrote:<br>
    </div>
    <blockquote
cite="mid:CAGeXoTWxH11Z3aJyt59Jeiyz6sTkmgkNmrb-k4Nj13Wjpx-tMA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello, 
        <div><br>
        </div>
        <div>
          <div>Just wanted to check if it is possible to write NGINX
            modules in C++ that makes extensive use of the standard
            template library (STL)? If so, what are the things that one
            needs to be careful about? </div>
          <div><br>
          </div>
          <div>Thanks in advance,</div>
          <div>Raj</div>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <table border="0" cellpadding="0" cellspacing="0">
              <tbody align="left" valign="top">
                <tr>
                  <td
                    style="vertical-align:top;text-align:left;white-space:nowrap"><br>
                  </td>
                  <td
                    style="vertical-align:top;text-align:left;white-space:nowrap">
                    <table border="0" cellpadding="0" cellspacing="0">
                      <tbody align="left" valign="top">
                      </tbody>
                    </table>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <br>
      <div
style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font
          size="1" color="#808080">This email and any attachments to it
          may be confidential and are intended solely for the use of the
          individual to whom it is addressed. Any views or opinions
          expressed are solely those of the author and do not
          necessarily represent those of Blis Ltd, a company registered
          in England and Wales with registered number 06455773. Its
          registered office is 5th Floor, 85 Tottenham Court Road,
          London, W1T 4TQ, United Kingdom.</font></div>
      <div
style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font
          size="1" color="#808080"><br>
        </font></div>
      <div
style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font
          size="1" color="#808080">If you are not the intended recipient
          of this email, you must neither take any action based upon its
          contents, nor copy or show it to anyone. Please contact the
          sender if you believe you have received this email in error.</font></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
nginx-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx-devel">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></pre>
    </blockquote>
    <br>
  </body>
</html>