using C++ templates
using C++ templates
- Subject: using C++ templates
- From: Piotr Rychlik <email@hidden>
- Date: Thu, 18 Feb 2010 00:38:59 +0100
Hi,
I have a problem with compiling the following code written in C++ using XCode:
Heder file: List.h
template<class T> class List { public: List(); ~List(); ........ };
Implementation file: List.cpp
template<class T> List<T>::List() { ........ }
template<class T> List<T>::~List() { ........ }
File: main.cpp
#include "List.h"
int main (int argc, char * const argv[]) { List<int> l; return 0; }
I receive the following link error:
Undefined symbols: "List<int>::List()", referenced from: _main in main.o "List<int>::~List()", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status
Is there something wrong with the code?
Regards, Piotr Rychlik
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden