Templates kai C++
Dimitris Tasoulis
dtas at math.upatras.gr
Tue Jul 22 21:09:03 EEST 2003
Geia xara, exo na kano mia periergi erotisi sxetika me tis template
claseis tis C++.
Exo ftia3ei mia template class (List.h) gia double linked list.
Prospa8o tora na kano compile to antistixo List.cpp kai ta kataferno mia
xara. Kanontas omos include to List.h sto main kai dinontas
sto g++ to List.o gia na kanei to linking den ta katafernei.
To error pou vgazei einai to e3is:
/tmp/ccxRfwoG.o: In function `main':
/tmp/ccxRfwoG.o(.text+0x22): undefined reference to `List<int>::add(int)'
collect2: ld returned 1 exit status
Mipos mporei na voi8eisei kapoios?
Episinapto ena tarball me me tin katastasi pou perigrafo.
Se ayto iparxoun 2 main arxeia. To ena (main_bad.cpp) einai ayto pou
parousiazei to provlima eno to allo (main_good.cpp) deixnei oti kati
tetoio mporei na ginei an kano include to List.cpp sto main.
Dimitris Tasoulis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: template_test.tar
Type: application/x-tar
Size: 10240 bytes
Desc:
URL: <http://lists.hellug.gr/pipermail/linux-greek-users/attachments/20030722/9f177a18/attachment.tar>
More information about the Linux-greek-users
mailing list