 <p>There are also problems defining functions in a header file. I thought I could inline them, but it seems I can only declare them.</p> <p>For instance, I had this header file,</p> <pre><code>// ShaderMath.h #pragma once using namespace metal; float4 conjugate(const float4 q); float4 conjugate(const float4 q) { return float4( -q.xyz, q.w ); } </code></pre> <p>If I include this header in more than one metal file, I get the "multiply defined" error. However, if I move the definition to a .metal file, then it works. The header file is just,</p> <pre><code>// ShaderMath.h #pragma once using namespace metal; float4 conjugate(const float4 q); </code></pre> <p>and the metal file,</p> <pre><code>// ShaderMath.metal #include &lt;metal_stdlib&gt; #include "ShaderMath.h" using namespace metal; float4 conjugate(const float4 q) { return float4( -q.xyz, q.w ); } </code></pre> <p>I hope this helps other people stuck with this same problem.</p>