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 9195425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:37:30+00:00 2026-06-17T21:37:30+00:00

I am getting this error in Visual Studio 2010 Pro: Error C2953: ‘list_1::Node’ :

  • 0

I am getting this error in Visual Studio 2010 Pro: “Error C2953: ‘list_1::Node’ : class template has already been defined”

Here is my Node.cpp class list that is getting the error (on line 24, the last line of the code.)

#include "Node.h"

namespace list_1
{
    template <typename T>
    struct Node
    {
        //Constructor
        Node<T>(T D)
        {
            data = d;
            next = NULL;        
        }
    }
;}

And the Node.H file:

#pragma once

namespace list_1
{
    template <typename T>
    struct Node
    {
        T data;
        Node<T> *next;

        // Constructor
        // Postcondition: 
        Node<T> (T d);
    };
}

I already looked here, which doesn’t help me since I am already using #pragma once, and in the list header file I have #ifndef LIST_H and #define LIST_H. This question doesn’t suit my needs and everything in this answer seems to be related to having the template bit that I already have.

If I try making it struct Node I get the error “error C2753: ‘list_1::Node’ : partial specialization cannot match argument list for primary template”

So I am at a loss at what to do. Please help.

  • 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-17T21:37:31+00:00Added an answer on June 17, 2026 at 9:37 pm

    I agree with your compiler.. You are defining the struct twice.

    To fix –

    Remove from your header.

    And your .cpp should look like this.

    #include "Node.h"
    
    namespace list_1
    {
        //Constructor
        template<typename T>
        Node<T>::Node(T D){
            ...
        }
    }
    

    Essentially, the struct block only appears in the header.

    Additionally I wonder if you are aware of the problems involving defining the template classes members in a .cpp file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this linker error in my Visual Studio 2010 project: ASWHighScores.obj :
I'm getting this linker error when compiling wxWidgets in Visual Studio 2010. msvcrt.lib(wcrtexew.obj) :
I am currently using TFS with Visual Studio 2010 Ultimate and getting this error
I keep getting this error: System.Runtime.InteropServices.COMException was thrown on C:\Users\---\documents\visual studio 2010\Projects\TBrowser\TBrowser\TBrowserWindow.xaml: Error HRESULT
While installing Visual Studio 2010 Service Pack 1, I am getting this error: Installation
Out of the blue today I started getting this error in Visual Studio 2008
To reproduce the error I'm getting: Create a new Visual Studio 2010 ASP.NET web
I was getting the below message from Visual Studio 2010. This project is incompatible
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Getting this error when try to add an item to my repositories/context: Collection has

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.