diff --git a/src/c_wrapper/utils.h b/src/c_wrapper/utils.h
index 40eacbcce2ee255ec6911ced901195245f913fe5..c2f01c8ec0153ea94580040ee8d2e96a040a7b06 100644
--- a/src/c_wrapper/utils.h
+++ b/src/c_wrapper/utils.h
@@ -90,6 +90,19 @@ print_buf(std::ostream &stm, const T *p, size_t len,
         }
     }
 }
+extern template void print_buf<char>(std::ostream&, const char*, size_t,
+                                     ArgType, bool, bool);
+extern template void print_buf<cl_int>(std::ostream&, const cl_int*, size_t,
+                                       ArgType, bool, bool);
+extern template void print_buf<cl_uint>(std::ostream&, const cl_uint*, size_t,
+                                        ArgType, bool, bool);
+extern template void print_buf<cl_long>(std::ostream&, const cl_long*, size_t,
+                                        ArgType, bool, bool);
+extern template void print_buf<cl_ulong>(std::ostream&, const cl_ulong*, size_t,
+                                         ArgType, bool, bool);
+extern template void print_buf<cl_image_format>(std::ostream&,
+                                                const cl_image_format*, size_t,
+                                                ArgType, bool, bool);
 
 // TODO
 template<typename T, class = void>
diff --git a/src/c_wrapper/wrap_cl.cpp b/src/c_wrapper/wrap_cl.cpp
index e9069c37719ff769cafa5377e1af6aa237cf015a..b7d1ddb9aa6ad9eef9d5427048a4bd93bf1d102b 100644
--- a/src/c_wrapper/wrap_cl.cpp
+++ b/src/c_wrapper/wrap_cl.cpp
@@ -14,6 +14,22 @@
 #include "program.h"
 #include "kernel.h"
 
+namespace pyopencl {
+template void print_buf<char>(std::ostream&, const char*, size_t,
+                              ArgType, bool, bool);
+template void print_buf<cl_int>(std::ostream&, const cl_int*, size_t,
+                                ArgType, bool, bool);
+template void print_buf<cl_uint>(std::ostream&, const cl_uint*, size_t,
+                                 ArgType, bool, bool);
+template void print_buf<cl_long>(std::ostream&, const cl_long*, size_t,
+                                 ArgType, bool, bool);
+template void print_buf<cl_ulong>(std::ostream&, const cl_ulong*, size_t,
+                                  ArgType, bool, bool);
+template void print_buf<cl_image_format>(std::ostream&,
+                                         const cl_image_format*, size_t,
+                                         ArgType, bool, bool);
+}
+
 // {{{ c wrapper
 
 // Import all the names in pyopencl namespace for c wrappers.