0
1>temp q.obj : error LNK2019: unresolved external symbol "public: __thiscall         queue<int>::~queue<int>(void)" (??1?$queue@H@@QAE@XZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: __thiscall  queue<double>::~queue<double>(void)" (??1?$queue@N@@QAE@XZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: __thiscall queue<char>::~queue<char>(void)" (??1?$queue@D@@QAE@XZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<double>::pop(void)" (?pop@?$queue@N@@QAEHXZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<char>::pop(void)" (?pop@?$queue@D@@QAEHXZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<int>::pop(void)" (?pop@?$queue@H@@QAEHXZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<double>::top(double &)" (?top@?$queue@N@@QAEHAAN@Z) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<int>::top(int &)" (?top@?$queue@H@@QAEHAAH@Z) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<char>::top(char &)" (?top@?$queue@D@@QAEHAAD@Z) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<char>::push(char)" (?push@?$queue@D@@QAEHD@Z) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<double>::push(double)" (?push@?$queue@N@@QAEHN@Z) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: int __thiscall queue<int>::push(int)" (?push@?$queue@H@@QAEHH@Z) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: __thiscall queue<char>::queue<char>(void)" (??0?$queue@D@@QAE@XZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: __thiscall queue<double>::queue<double>(void)" (??0?$queue@N@@QAE@XZ) referenced in function _main
1>temp q.obj : error LNK2019: unresolved external symbol "public: __thiscall queue<int>::queue<int>(void)" (??0?$queue@H@@QAE@XZ) referenced in function _main
1>C:\Users\a 2\Documents\Visual Studio 2010\Projects\temp stack\Debug\temp stack.exe : fatal error LNK1120: 15 unresolved externals

Can someone please highlight what kind of errors are these?

Saksham
  • 9,037
  • 7
  • 45
  • 73
  • 2
    You need to either compile the .cpp file which implements `queue` or link to a library which implements it. BTW, I've removed the C tag since the errors show that you're using C++ – simonc Oct 25 '13 at 18:41
  • 4
    Linker kind of this errors – Armen Tsirunyan Oct 25 '13 at 18:41
  • Something says me you've put the implementation of `queue` methods in a cpp file!? – masoud Oct 25 '13 at 18:45
  • ok i put the implement in class and put the header (queue.h) .. i donot have any thing about this error and i'n sorry about tag (c) :) – Anas Shami Oct 25 '13 at 18:46
  • i tried this ,, but the errors raised – Anas Shami Oct 25 '13 at 18:47
  • What are the cpp/header files you created? and what did you include/implement in each of them? That helps us suggest you how to compile and link the pieces – theAlias Oct 25 '13 at 19:09
  • queue.h-> that is class... #pragma once #include using namespace std; #define success 0 #define overflow -1 #define underflow -2 typedef int error; template struct Node{ T data; Node *next; }; template class queue{ protected: Node * front; Node * rear; int c; public: queue(); ~queue(); error pop(); error top(T &x); error push(T x); bool empty(); bool full(){return false;} }; – Anas Shami Oct 25 '13 at 20:07
  • @AnasShami: That header doesn't define the functions, it only declares them. Templates usually need to be defined in headers, as described in [this question](http://stackoverflow.com/questions/495021). – Mike Seymour Oct 25 '13 at 21:25
  • i define it as a header (template) – Anas Shami Oct 26 '13 at 15:05

1 Answers1

0

It is a linker error. There is code somewhere trying to call the functions for the queue class, but there is no queue class linked into the executable.

http://www.cprogramming.com/tutorial/compiler_linker_errors.html

srzdev
  • 202
  • 1
  • 2
  • 10