Function template overloading: link error

Posted by matt on Stack Overflow See other posts from Stack Overflow or by matt
Published on 2010-04-23T14:28:52Z Indexed on 2010/04/23 14:33 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

I'm trying to overload a "display" method as follows:

template <typename T> void imShow(T* img, int ImgW, int ImgH);
template <typename T1, typename T2> void imShow(T1* img1, T2* img2, int ImgW, int ImgH);

I am then calling the template with unsigned char* im1 and char* im2:

imShow(im1, im2, ImgW, ImgH);

This compiles fine, but i get a link error "unresolved external symbol" for:

imShow<unsigned char,char>(unsigned char *,char *,int,int)

I don't understand what I did wrong!

© Stack Overflow or respective owner

Related posts about c++

Related posts about function