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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:32:42+00:00 2026-06-01T01:32:42+00:00

ERROR CODE: CList<CString,const char*> test; ERROR INFO: ECLIPSE / UBUNTU 10 /home/latyas/workspace/CList/Debug/../test.cpp:7: undefined reference

  • 0
ERROR CODE:

    CList<CString,const char*> test;

ERROR INFO:
    ECLIPSE / UBUNTU 10

/home/latyas/workspace/CList/Debug/../test.cpp:7: undefined reference
            to `CList<CString, char const*>::CList()'

I have already defined this constructor:

template<typename T1, typename T2> CList<T1, T2>::CList() :
        m_nHead(0), m_nTail(0),m_nCount(0) {
}

Why am I getting this error?

updated:

#include <iostream>
#include "CString.h"
#include "CList.h"

int main()
{
    CList<CString,const char*> test;
    test.AddHead("test");
    return 0;
}


/*
 * CList.h
 *
 *  Created on: 2012-3-31
 *      Author: latyas
 */

#ifndef CLIST_H_
#define CLIST_H_


template<typename T1,typename T2> class CList {
public:
    struct CNode {
        CNode* pNext;
        CNode* pPrev;
        T1 data;
    };
    CList();
    ~CList();
    long GetHead();
    long GetTail();
    long GetNext(long, T1&); 
    long GetCount();
    long AddHead(T2);
    long AddTail(T2);
    long RemoveAt(long);

private:
    CNode* m_nHead;
    CNode* m_nTail;
    long m_nCount;

};

#endif /* CLIST_H_ */

/*
 * CList.cpp
 *
 *  Created on: 2012-3-31
 *      Author: latyas
 */

#include "CList.h"
#include <cstdlib>
#include <iostream>

/
template<typename T1, typename T2> CList<T1, T2>::CList() :
        m_nHead(0), m_nTail(0),m_nCount(0) {
}
template<class T1, class T2> CList<T1, T2>::~CList() {
    std::cout << "~CList()";
  • 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-01T01:32:43+00:00Added an answer on June 1, 2026 at 1:32 am

    There is no .cpp file for templated classes, so all your implementation must be done in the .h file only..

    /*
     * CList.h
     */
    
    #ifndef CLIST_H_
    #define CLIST_H_
    
    
    template<typename T1,typename T2> class CList {
    public:
        struct CNode {
            CNode* pNext;
            CNode* pPrev;
            T1 data;
        };
        CList();
        ~CList();
        long GetHead();
        long GetTail();
        long GetNext(long, T1&); 
        long GetCount();
        long AddHead(T2);
        long AddTail(T2);
        long RemoveAt(long);
    
    private:
        CNode* m_nHead;
        CNode* m_nTail;
        long m_nCount;
    
    };
    
    #endif /* CLIST_H_ */
    
    /* ========== Implementation of Clist class ============ */
    
    template<typename T1, typename T2> CList<T1, T2>::CList() :
            m_nHead(0), m_nTail(0),m_nCount(0) {
    }
    template<class T1, class T2> CList<T1, T2>::~CList() {
        std::cout << "~CList()";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm recieving the following error code when trying to test run an app. Application
After adding a test for error code to MKReverseGeocoder's callback, got a linker error
If I get an error code result from a Cocoa function, is there any
Here's the error code: The app you are using is not responding. Please try
I am continuously getting Error Code The ORA-01033: ORACLE initialization or shutdown in progress
Is it possible to get the error code returned by the operating system to
I am using this php code: exec(unrar e file.rar,$ret,$code); and getting an error code
Our packages are randomly failing with the following error message: SSIS Error Code DTS_E_OLEDBERROR
Is it possible to have the router return an error code (or an entire
In previous versions of Visual Studio I remember I saw the error code/number in

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.