link error

i keep getting this error:

error LNK2019: unresolved external symbol "class std::vector<int,class std::allocator<int> > __cdecl alternateMerge<int>(class std::vector<int,class std::allocator<int> > &,class std::vector<int,class std::allocator<int> > &)" ( $alternateMerge@H@@YA AV $vector@HV $allocator@H@std@@@std@@AAV01@0@Z) referenced in function _main

i have the following code in my program which i suspect is the cause, but cant find a way to resolve it.

template<class T>
vector alternateMerge(vector<T> &u, vector<T> &v)
{
vector<int> w; //new vector
function body
return w;
}

i'm trying to merge two vectors and return a vector to main.

thanks.



Answer this question

link error

  • SnowLover

    nevermind i figured it out.

  • link error