having problems troubleshooting this lnk error

This code has thrown me for a big loop I keep getting a lnk error but not sure why and also not sure how to go about finding to fix it either. can someone get me going in the right direction please.

here is my .h file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// FILE: washing.h (part of the namespace main_savitch_8A)
// CLASSES PROVIDED: bool_source, averager, washer.
//
// CONSTRUCTOR for the bool_source class:
//   bool_source(double p = 0.5)
//     Precondition: 0 <= p <= 1.
//     Postcondition: The bool_source has been initialized so that p is the
//     approximate probability of returning true in any subsequent activation
//     of query( ).
//
// CONSTANT MEMBER FUNCTION for the bool_source class:
//   bool query( ) const
//     Postcondition: The return value is either true or false, with the
//     probability of a true value being approximately p (from the constructor).
//
// CONSTRUCTOR for the averager class:
//   averager( )
//     Postcondition: The averager has been initialized so that it
//     is ready to accept a sequence of numbers to average.
//
// MODIFICATION MEMBER FUNCTION for the averager class:
//   void next_number(double value)
//     Postcondition: The averager has accepted value as the next
//     number in the sequence of numbers which it is averaging.
//
// CONSTANT MEMBER FUNCTIONS for the averager class:
//   size_t how_many_numbers( ) const
//     Postcondition: The value returned is a count of how many
//     times next_number has been activated.
//
//   double average( ) const
//     Precondition: how_many_numbers > 0.
//     Postcondition: The value returned is the average of all the
//     numbers which have been given to the averager.
//
// CONSTRUCTOR for the washer class:
//   washer(unsigned int s = 60)
//     Precondition: The value of s is the number of seconds needed for
//     the completion of one wash cycle.
//     Postcondition: The washer has been initialized so that all
//     other member functions may be used.
//
// MODIFICATION MEMBER FUNCTIONS for the washer class:
//   void one_second( )
//     Postcondition: The washer has recorded (and simulated) the
//     passage of one more second of time.
//
//   void start_washing( )
//     Precondition: The washer is not busy.
//     Postcondition: The washer has started simulating one wash
//     cycle. Therefore, is_busy( ) will return true until
//     the required number of simulated seconds have occured.
//
// CONSTANT MEMBER FUNCTIONS for the washer class:
//   bool is_busy( ) const
//     Postcondition: Return value is true if the washer is busy
//     (in a wash cycle); otherwise the return value is false.
//
// VALUE SEMANTICS for the bool_source, averager, and washer classes:
//   Assignments and the copy constructor may be used with the three classes.
//

#ifndef MAIN_SAVITCH_WASHING_H
#define MAIN_SAVITCH_WASHING_H
#include <cstdlib> // Provides std::size_t


namespace main_savitch_8A
{

    class bool_source
    {
    public:
        // CONSTRUCTOR
        bool_source(double p = 0.5);
        // CONSTANT function
        bool query( ) const;
    private:
        double probability; // Probability of query( ) returning true
    };

    class averager
    {
    public:
        // CONSTRUCTOR
        averager( );
		
        // MODIFICATION function
        void next_number(double value);
        // CONSTANT functions
        size_t how_many_numbers( ) const { return count; }
        double average( ) const;
    private:
        size_t count; // How many numbers have been given to the averager
        double sum;   // Sum of all the numbers given to the averager
    };

    class washer
    {
    public:
        // CONSTRUCTOR
        washer(unsigned int s = 60);
        // MODIFICATION functions
        void one_second( );
        void start_washing( );
        // CONSTANT function
        bool is_busy( ) const { return (wash_time_left > 0); }
    private:
        unsigned int seconds_for_wash; // Seconds for a single wash
        unsigned int wash_time_left;   // Seconds until washer no longer busy
    };
}

#endif 

This code was taken from a Colorado edu site with the instructions to change some functions to take the letters 'c' 'o' 'r' 'r' 'e' 'c' 't' in a list and put them through a queue to output the word correct on the screen.

here is the cpp file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// FILE: carwash.cxx
// A small test program to test the car_wash_simulate function.


#include <cstdlib>    // Provides EXIT_SUCCESS
#include <deque>
#include <iostream>   // Provides cout
#include <list>
#include <queue>      // Provides queue
#include "washing.h" // Provides averager, bool_source, washer




//using namespace std;
using namespace main_savitch_8A;

  template <class T, class Container = list<T> >

  class node {

    public:

      // typedefs
      typedef typename Container::value_type value_type;
      typedef typename Container::size_type size_type;
      typedef Container container_type;

      // Construct/Copy/Destroy
      explicit node (const Container& = Container());

      // Accessors
     bool empty () const;
     size_type size () const;
     value_type& front ();
     const value_type& front () const;
     value_type& back ();
     const value_type& back () const;
     void push (const value_type&);
     void pop ();
  };


int main( )
{
//	typedef node<char, std::deque<char, std::allocator<char> > > SQueue;

//typedef node<int, std::deque<std::allocator<int> > > SQueue;
typedef node<char, std::list<char, std::allocator<int> > >IQueue;


	IQueue letters;
/*	letters.push('c');
	letters.push('o');
	letters.push('r');
    letters.push('r');
    letters.push('e');
    letters.push('c');
    letters.push('t');
	for(int i= 0; i < letters.size(); i++)
	{
		std::cout << letters.front();
		letters.pop();
	} */


    return EXIT_SUCCESS;
}


please excuse all the commented lines as that's the way I have been trying to troubleshoot this for over a week now.

Again any help is appreciated
Gary
What's the error?
The error is as follows

carwash2.obj : error LNK2019: unresolved external symbol "public: __thiscall node<char,class std::list<char,class std::allocator<int> > >::node<char,class std::list<char,class std::allocator<int> > >(class std::list<char,class std::allocator<int> > const &)" (??0?$node@DV?$list@DV?$allocator@H@std@@@std@@@@QAE@ABV?$list@DV?$allocator@H@std@@@std@@@Z) referenced in function _main
It can't find the code for the constructor of template class node.

BTW, why does your char node have an int allocator?
my explicit node constructor does not work in this case? I need to make a constructor for the template itself?

The allocator I used from a site to help me with the queue class I should change this to a char allocator?
You haven't provided the code for the constructor, or any other methods in node. You've only declared them.
Topic archived. No new replies allowed.