Then shouldn't you be really kind and post those 10 lines in a reply to the original poster, instead of whinging about people helping.
I think I've just been suckered into troll-feeding...
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
when i changed the main function of a template class into a separate file, i have got a link error.Display is a function in the template class
error LNK2001: unresolved external symbol "public: void __thiscall Gen_Queue<int>::Display(void)" (?Display@?$Gen_Queue@H@@QAEXXZ)
What may be the problem?
Anyone know the solution?
I was coding a generic queue. i have made GenericQueue.cpp with functions Add(), delete() and display(). genericQueue.h have the variables and declaration of the functions.
In another file GenericQueueMain.cpp i have written the function main() for the generic queue. I have made an object for the GenericQueue and tried to call the functions . Then i got the error-- error LNK2001: unresolved external symbol "public: void __thiscall Gen_Queue<int>::Display(void)" (?Display@?$Gen_Queue@H@@QAEXXZ)
Your question is not really clear but I guess you are trying to move the definition of a template class from a header file to a cpp file. Am I right ?
If that is the case, you can't do something like that. For a template class, the full definition of the class and functions has to be known when compiling, thus you have to include everything in the header file. One 'trick' to get around that problem is to move the definition in a .inl file (to differentiate from a standard cpp file) and include that file in your header file (at the bottom of the file).
i am writing a video processing application. at first i tried to use OpenCV and it was greate as it had very high performance. but i need to implement some functions by myself and i am doing this. but the main peroblem is the "performance". for example, i used the cvSub(...) funcation to subtract two 2D arrays. and then i tried to do this with a simple "for loop". the calculation times are shown below:
openCV : 0.135496 ms
mycode : 0.376614 ms
and i ran the program several times and the result was the same.
so i am here to ask :
do you have any idea for performing the task as fast as OpenCV?