title: Can I include/import a single function from a library in C++
body: <p>I only need to use the <code>iequals</code> case-insensitive string comparison function from the BOOST library.</p>
  
  <p>I am using <code>#include &lt;boost/algorithm/string.hpp&gt;</code> to import it.</p>
  
  <p>Is there any way that I could only import the <code>iequals</code> function by itself?</p>
  
  <p>The reason I even care (I am really just curious.) is because the compiled DLL is about 230kB if I don't <code>#include</code> it and about 1.1MB if I do.  It doesn't really make much difference in this particular case how large the file is, but it seems like there is a lot of stuff that gets imported and never used.  What if the library was a few GB and I only needed one of the functions?  Then it would become an issue, I imagine.</p>
  
  <p>I am admittedly naive when it comes to just about anything cpp-related, but I feel like it isn't very efficient to include some 750kB of code when probably 90% of it isn't used.  It could be that the <code>iequals</code> function uses all of that 750kB, I have no idea.</p>
  
  <p>Then again, if the <code>iequals</code> function includes many of the same libraries, the file would still be just as large.</p>
  
  <p>Thoughts?</p>
  
  <p>Thanks in advance for any advice.</p>
  
  <p>EDIT:</p>
  
  <p>Thanks for the responses.  I am doing my best to understand them.</p>
  
  <p>I am a chemical engineer who is rewriting a bunch of horribly slow and poorly optimized VBA macros into a C++ DLL.  So far the results have been outstanding and everything functions correctly.  I just don't see the need for the extra file size if I only need to do a single type of comparison between two strings.</p>
  
  <p>An example of the comparison I need to do is as follows:</p>
  
  <pre><code>if (SomeBSTR == "SomeTextHere") {
      // do stuff
  }
  </code></pre>
  
  <p>or more exactly:</p>
  
  <pre><code>if (Gas == "Methane"    or
      Gas == "CH4"        or
      Gas == "C1")        return 1;
  
  if (Gas == "Ethane"     or
      Gas == "C2H6"       or
      Gas == "C2")        return 2;
  </code></pre>
  
  <p>If this is the ONLY type of comparison that I have to do, can I do it in a more simple way than:</p>
  
  <pre><code>int wStrCmp(const BSTR Str1, const wstring Str2) {
  
      wstring wStr1(Str1, SysStringLen(Str1));
  
      return boost::iequals(Str1, Str2);
  }
  </code></pre>
  
  <p>which is called via:</p>
  
  <pre><code>if (wStrCmp(Gas, L"Methane")      or
      wStrCmp(Gas, L"CH4")          or
      wStrCmp(Gas, L"C1"))          return 1; 
  </code></pre>
  
  <p>Those last 2 blocks are practically pasted from my code.</p>
  
  <p>Thanks again, guys.</p>