|
-
August 24th, 2009, 10:42 AM
#8
Re: Design problem with a virtual template class
@Muthuveerappan
Ok, now I'm really confused: your code compile and work O_o
I thought, as I've read since now, that templates cannot be virtual... so if this can be possibile what's wrong with my code?
That's the error I get:
Code:
Building target: testVari
Invoking: GCC C++ Linker
g++ -o"testVari" ./src/ArrayMatrix.o ./src/TestSingleton.o ./src/VectorMatrix.o ./src/mah.o ./src/testVari.o
./src/testVari.o: In function `main':
/mnt/data/opt/workspace/testVariC++/Debug/../src/testVari.cpp:40: multiple definition of `main'
./src/mah.o:/mnt/data/opt/workspace/testVariC++/Debug/../src/mah.cpp:24: first defined here
./src/testVari.o: In function `ArrayMatrix<int>::~ArrayMatrix()':
testVari.cpp:(.text._ZN11ArrayMatrixIiED0Ev[ArrayMatrix<int>::~ArrayMatrix()]+0x2e): undefined reference to `Matrix<int>::~Matrix()'
./src/testVari.o: In function `ArrayMatrix<int>::~ArrayMatrix()':
testVari.cpp:(.text._ZN11ArrayMatrixIiED1Ev[ArrayMatrix<int>::~ArrayMatrix()]+0x2e): undefined reference to `Matrix<int>::~Matrix()'
./src/testVari.o: In function `ArrayMatrix<int>::ArrayMatrix(unsigned int, unsigned int)':
testVari.cpp:(.text._ZN11ArrayMatrixIiEC1Ejj[ArrayMatrix<int>::ArrayMatrix(unsigned int, unsigned int)]+0x62): undefined reference to `Matrix<int>::~Matrix()'
collect2: ld returned 1 exit status
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|