I've created a function template that allows me to get data for any data type but am receiving the error message on compilation:
Undefined symbols for architecture i386:
"bool Json::getData<double>(double, Json&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DataType)", referenced from:
Coupon::initCoupon(int const&, Json&)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.
The function is declared as:
template < class T> static bool getData(T data, Json &jsonObject, const string &key, DataType dataType);
and called as:
Json::getData (couponList[cpnCnt].discount, couponReader, "discount", realType);
where couponList[cpnCnt].discount
is a double.
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.