Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created October 5, 2011 23:28
Show Gist options
  • Select an option

  • Save KushalP/1266046 to your computer and use it in GitHub Desktop.

Select an option

Save KushalP/1266046 to your computer and use it in GitHub Desktop.
namespace base {
namespace mac {
template<typename T> T CFCast(CFTypeRef cf_val) {
if (!cf_val) return NULL;
if (CFGetTypeID(cf_val) == CFStringGetTypeID()) {
return (CFStringRef)cf_val;
}
return NULL;
}
} // namespace mac
} // namespace base
namespace base {
mac {
template<typename T> T CFCast(CFTypeRef cf_val);
}
}
LINK(target) out/Debug/base_unittests
Undefined symbols:
"__ZN4base3mac6CFCastIPK10__CFStringEET_PKv", referenced from:
__ZN29CFCastTest_ToCFStringRef_Test8TestBodyEv in foundation_util_unittest.o
"__ZN4base3mac6CFCastIPK14__CFDictionaryEET_PKv", referenced from:
__ZN33CFCastTest_ToCFDictionaryRef_Test8TestBodyEv in foundation_util_unittest.o
ld: symbol(s) not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
LINK(target) out/Debug/base_unittests: Finished
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment