Note that there are some explanatory texts on larger screens.

plurals
  1. POError LNK2019 simple Linked List implementation
    primarykey
    data
    text
    <p>I am implementing a simple Linked List, but I keep getting the LNK2019 error, I simplified my code to the minimum to track the problem,but I keep getting it. I am using Visual Studio 2010. My header file is:</p> <pre><code>#ifndef __TSLinkedList__H__ #define __TSLinkedList__H__ #if _MSC_VER &gt; 1000 #pragma once #endif // _MSC_VER &gt; 1000 #include "LinkedNode.h" template &lt;class T&gt; class LinkedList { public: LinkedList(void); ~LinkedList(void); protected: LinkedNode&lt;T&gt; * head; }; </code></pre> <p>The implementation file is:</p> <pre><code>#include "StdAfx.h" #include "LinkedList.h" template &lt;class T&gt; LinkedList&lt;T&gt;::LinkedList(void) { head = NULL; } template &lt;class T&gt; LinkedList&lt;T&gt;::~LinkedList(void) { } </code></pre> <p>the main function is:</p> <pre><code>#include "stdafx.h" #include "stdlib.h" #include "LinkedList.h" int _tmain(int argc, _TCHAR* argv[]) { LinkedList&lt;int&gt; mList; system("PAUSE"); return 0; } </code></pre> <p>and I am getting this error:</p> <p>Error 1 error LNK2019: símbolo externo "public: __thiscall LinkedList::~LinkedList(void)" (??1?$LinkedList@H@@QAE@XZ) in function _wmain </p> <p>I get the same error with the Constructor. The funny thing is that it is pointing to _wmain, and my main function is called _tmain. I already tried to change Subsystem linker from /SUBSYSTEM:WINODWS to /SUBSYSTEM:CONSOLE, but it was already set up as /SUBSYSTEM:CONSOLE. Obviously my implementation does a lot more than this, but I ripped out all of it to track this problem. Help wpuld be apreciated, this is driving me nuts. I am new to C++.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload