Problem with .o files

hello ...:)
T have some files in C++. I tried it to compile into .o file. I managed it.
I Created file main.cpp and I have compiled into the executable program ...i launch this program and I got an ERROR message:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
h@h-desktop:~/Documents/my$ make
g++  -o myapp Array.a main.o
main.o: In function `main':
/home/h/Documents/my/main.cpp:6: undefined reference to `Array<char, int, int>::Array(int)'
/home/h/Documents/my/main.cpp:7: undefined reference to `Array<char, int, int>::Array()'
/home/h/Documents/my/main.cpp:8: undefined reference to `Array<char, int, int>::operator=(char const*)'
/home/h/Documents/my/main.cpp:9: undefined reference to `Array<char, int, int>::operator=(char const*)'
/home/h/Documents/my/main.cpp:11: undefined reference to `Array<char, int, int>::operator+(Array<char, int, int> const&)'
/home/h/Documents/my/main.cpp:11: undefined reference to `Array<char, int, int>::operator=(Array<char, int, int> const&)'
/home/h/Documents/my/main.cpp:11: undefined reference to `Array<char, int, int>::~Array()'
/home/h/Documents/my/main.cpp:11: undefined reference to `Array<char, int, int>::~Array()'
/home/h/Documents/my/main.cpp:12: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& operator<< <int, int>(std::basic_ostream<char, std::char_traits<char> >&, Array<char, int, int>&)'
/home/h/Documents/my/main.cpp:13: undefined reference to `Array<char, int, int>::~Array()'
/home/h/Documents/my/main.cpp:13: undefined reference to `Array<char, int, int>::~Array()'
/home/h/Documents/my/main.cpp:13: undefined reference to `Array<char, int, int>::~Array()'
/home/h/Documents/my/main.cpp:13: undefined reference to `Array<char, int, int>::~Array()'
collect2: ld returned 1 exit status
make: *** [myapp] Error 1
h@h-desktop:~/Documents/my$ 


what I doing wrong ? object file are about 2.1Kb large (from ~30Kb)...

PleasePlease Help meee ...

thanks
Last edited on
Templates must be completed implemented within the header file.
Topic archived. No new replies allowed.