title: Function template linking error
body: <p>I've created a function template that allows me to get data for any data type but am receiving the error message on compilation:</p>
  
  <pre><code>Undefined symbols for architecture i386:
    "bool Json::getData&lt;double&gt;(double, Json&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, DataType)", referenced from:
        Coupon::initCoupon(int const&amp;, Json&amp;)in libkuapay.a(Coupon.o)
  ld: symbol(s) not found for architecture i386
  collect2: ld returned 1 exit status
  scons: *** [kuaposgw] Error 1
  scons: building terminated because of errors.
  </code></pre>
  
  <p>The function is declared as:</p>
  
  <pre><code> template &lt; class T&gt; static bool getData(T data, Json &amp;jsonObject, const string &amp;key, DataType dataType);
  </code></pre>
  
  <p>and called as:</p>
  
  <pre><code> Json::getData (couponList[cpnCnt].discount, couponReader, "discount", realType);
  </code></pre>
  
  <p>where <code>couponList[cpnCnt].discount</code> is a double.</p>
  
  <p>The code itself compiles fine in my "inner" directory but I get the error message above in the
  "outer" directory, where the latter is essentially a wrapper of the inner code.</p>