I compiled a c library (for use by a C ++ project) with clang. When I tried to link this library, I got linker errors (in particular, the undefined character relative to the hqxInit function). When I switch to clang ++, it works. Checking with nm, clang ++ calls the names again. What happens, and is there a better way to tell the linker that the library is running for-c versus munged-for-C ++? It seems silly to create a c library with C ++ ....
// built with clang
$ nm libhqx.a libhqx.bak(init.co) 04000000 C _RGBtoYUV 00000004 C _YUV1 00000004 C _YUV2 00000000 T _hqxInit
// built using clang ++
$ nm libhqx.a libhqx.a(init.o): 00000100 S _RGBtoYUV 04000100 S _YUV1 04000104 S _YUV2 00000000 T __Z7hqxInitv
source share