extern "C" template

how can i solve this problem? has anyone faced with this problem?

// declaration, forward

extern "C" void run(const int argc, const char** argv, csr_matrix<IndexType,ValueType> *csr);

template <typename IndexType, typename ValueType>

void

run(const int argc, const char** argv, csr_matrix<IndexType,ValueType> *csr)

...

}

Error:

error: identifier "IndexType" is undefined

error: identifier "ValueType" is undefined

Err… you’re asking how to put a C++ template into what is (basically) a C function? I don’t see that working somehow. You could write a wrapper function (with C linkage) that then calls the templated function with appropriate arguments, but you’ll need to special case that for every combination of types you want. That could get messy pretty fast.