Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8213265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:03:29+00:00 2026-06-07T11:03:29+00:00

I am implementing a simple Linked List, but I keep getting the LNK2019 error,

  • 0

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:

#ifndef __TSLinkedList__H__
#define __TSLinkedList__H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "LinkedNode.h"

template <class T>
class LinkedList
{
public:
LinkedList(void);
~LinkedList(void);
protected:
LinkedNode<T> * head;
};

The implementation file is:

#include "StdAfx.h"
#include "LinkedList.h"

template <class T>
LinkedList<T>::LinkedList(void)
{
head = NULL;
}
template <class T>
LinkedList<T>::~LinkedList(void)
{
}

the main function is:

#include "stdafx.h"
#include "stdlib.h"
#include "LinkedList.h"

int _tmain(int argc, _TCHAR* argv[])
{
LinkedList<int> mList;
system("PAUSE");
return 0;
} 

and I am getting this error:

Error 1 error LNK2019: símbolo externo “public: __thiscall LinkedList::~LinkedList(void)” (??1?$LinkedList@H@@QAE@XZ) in function _wmain

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++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:03:31+00:00Added an answer on June 7, 2026 at 11:03 am

    Move the function implementations to the header file.

    In order to generate code for the specialization, the compiler must have the definitions of the functions available to each translation unit.

    #ifndef __TSLinkedList__H__
    #define __TSLinkedList__H__
    
    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000
    
    #include "LinkedNode.h"
    template <class T>
    class LinkedList
    {
    public:
        LinkedList(void);
        ~LinkedList(void);
        protected:
        LinkedNode<T> * head;
    };
    
    template <class T>
    LinkedList<T>::LinkedList(void)
    {
    head = NULL;
    }
    template <class T>
    LinkedList<T>::~LinkedList(void)
    {
    }
    
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
I'm implementing a simple password store using Blowfish. All was fine until I tried
I have a problem with implementing a simple NegaMax in my chess programm. According
i am implementing the simple bubble sort algorithm using CUDA, and i have a
I'm working on implementing a dynamic linked list in C just to brush up
I'm currently implementing a copy constructor for a Linked List class. When I create
I am implementing simple version of TCP, but lack of multi-thread technique. The main
I'm implementing a simple Facebook Like button on a voting site but want an
I’m implementing a simple HttpModule, where I want some code to run when the
I'm implementing a doubly linked list just for fun and for a refresher and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.