title: Why include guards do not prevent multiple function definitions?
body: <p>The linker reports duplicate symbol on this:</p>
  
  <pre><code>#ifndef testttt
  #define testttt
  
  void anything(){
      std::cout&lt;&lt;"hellooooooo";
  }
  
  #endif
  </code></pre>
  
  <p>Because it is inside the include guards, I would expect that this function is only defined once. But apparently not.</p>
  
  <p>I know I can put the word <code>static</code> in front of it and then it will work (which I still find ironic, since static is supposed to give it internal linkage, yet the function can be used from multiple cpp files).</p>
  
  <p>So I guess my two-part question is: 1) Why do the include guards not prevent multiple definitions of this function like they do for other header items, and 2) Why does the <code>static</code> word resolve this when static is supposed to <em>prevent</em> names from visibility in other translation units? I add it, and I can actually call this function from anywhere that includes this header file.</p>