Linked Questions

215 votes
3 answers
178k views

I have no idea why this is happenning, since I think I have everything properly declared and defined. I have the following program, designed with templates. It's a simple implementation of a queue, ...
Heathcliff's user avatar
  • 3,168
76 votes
6 answers
67k views

I have very little idea what's going in regards to C++ templates, but I'm trying to implement a function that searches a vector for an element satisfying a given property (in this case, searching for ...
marsolk's user avatar
  • 1,003
129 votes
3 answers
95k views

When I write C++ code for a class using templates and split the code between a source (CPP) file and a header (H) file, I get a whole lot of "unresolved external symbol" errors when it comes to ...
dlanod's user avatar
  • 9,129
49 votes
6 answers
33k views

I have a problem in calling a template class I have. I declared a new type name Array, which is a template; In the .hpp file: template <typename T> class Array { public: Array(); }; In the ....
Boris Raznikov's user avatar
55 votes
3 answers
50k views

This has been driving me mad for the past hour and a half. I know it's a small thing but cannot find what's wrong (the fact that it's a rainy Friday afternoon, of course, does not help). I have ...
recipriversexclusion's user avatar
38 votes
4 answers
69k views

So, I heard that C++ templates shouldn't be separated into a header (.h) and source (.cpp) files. For instance, a template like this: template <class T> class J { T something; }; Is this ...
kamikaze_pilot's user avatar
44 votes
4 answers
17k views

Why should the implementation and the declaration of a template class be in the same header file? Could any of you explain it by example?
Haiyuan Zhang's user avatar
25 votes
4 answers
25k views

Been away from C++ for a few years and am getting a linker error from the following code: Gene.h #ifndef GENE_H_INCLUDED #define GENE_H_INCLUDED template <typename T> class Gene { public: ...
Ryan_IRL's user avatar
  • 585
14 votes
5 answers
19k views

Normally when I create a class, I create a header and a source for that class. I have heard that with a template class, you have to put the function implementation in the header. I tried doing it both ...
cat pants's user avatar
  • 1,563
17 votes
2 answers
42k views

Ok guys... I have following class #include <functional> template <typename TValue, typename TPred = std::less<TValue>> class BinarySearchTree { struct TNode { TValue ...
xlw12's user avatar
  • 781
8 votes
3 answers
25k views

I tried to google this but always come back with different issues. I am getting 3 unresolved externals when I try to compile this program: 1>main.obj : error LNK2019: unresolved external symbol "...
chadpeppers's user avatar
  • 2,058
17 votes
5 answers
11k views

Possible Duplicate: Why can templates only be implemented in the header file? I've been trying around with C++ recently. At the moment I'm trying to program something I'm sure everone has done at ...
haiyyu's user avatar
  • 2,242
8 votes
4 answers
14k views

I've seen a few related posts, but I can't really make sense of what I need to do to fix a program I'm making for my entry-level C++ class. My errors are: Build Final Project of project Final ...
Nick Sweet's user avatar
  • 2,129
7 votes
1 answer
8k views

I'm getting an "unresolved external symbol "public:__thiscall hijo<int>::hijo<int>(void)" referenced in function_main I started a new project cause I was having this same error on another ...
HoNgOuRu's user avatar
  • 727
3 votes
2 answers
25k views

I have written a template class, for a map/dictionary data structure, and keep getting this strange error (ERROR LNK2019:unresolved external symbol) Code: AssArray.h: #pragma once template <...
Nattfrosten's user avatar
  • 2,149

15 30 50 per page
1
2 3 4 5
119