Sounds like your missing an object file at the linking stage. Without seeing your code or makefile it's not very easy to pinpoint your problem. My guess is that your Matrix template has some underlying code. You then derive Relation from Matrix but don't actually link in the Matrix code when building, which is still needed by Relation! RikD.
-----Original Message----- From: Praise [mailto:praisetazio@tiscalinet.it] Sent: 05 April 2002 21:43 To: suse-linux-e@suse.com Subject: [SLE] Problem programming C++
Sorry if this is a little off topic.
I have none experience with gcc, and very little experience with c++. So I am experimenting a bit. I have done a class template, Matrix,and everything is good with it. Just to try, I have derived from this class template a common class, called Relation. As a relation is rapresented as a matrix of double, I have derived it from Matrix<double>. My syntax is good, so I do not receive any error when I compile the relation.cpp file. The problem comes out at linking time: every function which is inherited by Matrix <double> and not redefined causes an error:
"home/praise/fuzzycmeans/fuzzycmeans/relation.cpp:42: undefined reference to `Matrix<double>::at(int, int) const'
I also have these errors: /usr/include/g++/stl_alloc.h(.text+0xf): undefined reference to `Matrix<double>::Matrix(void)' /usr/include/g++/stl_alloc.h(.text+0x37): undefined reference to `Matrix<double>::~Matrix(void)'
/usr/include/g++/stl_alloc.h(.gnu.linkonce.d.__vt_9Relazione+0 x24): undefined reference to `Matrix<double>::operator[](int) const'
I do not know what this means. Anyone could help?
Praise
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
Il 21:00, sabato 6 aprile 2002, Dunphy Richard-rdunph01 ha scritto:
Sounds like your missing an object file at the linking stage.
Without seeing your code or makefile it's not very easy to pinpoint your problem.
My guess is that your Matrix template has some underlying code. You then derive Relation from Matrix but don't actually link in the Matrix code when building, which is still needed by Relation!
RikD.
I have solved the problem:-) I forgot that template classes need no cpp file. Everything must go into the .h file. Done that, solved the problem.-) Dumb me! Praise
A word to all you: I really enjoy reading this list and always learn something new from all you guys.... Except... those messages where the pros do blame someone's mistakes or just a message out of topic. Do you think this is the way to promote our OS to be user friendly? Are you user friendly at all??? Perhaps you guys should be using the list suse-linux-experts&pros-highlevel-only4hackers@suse.com ? It's not about Praise... it's about everybody that has been blamed in this list... It's about me having to read your bull-shit... You just fill my mail box with your unfair crap. By the way, sorry for my little piece crap-mail in your box. Hope this cause some reflexion in some people. Have a nice we :-) Pep Serrano.
I have solved the problem:-) I forgot that template classes need no cpp file. Everything must go into the .h file. Done that, solved the problem.-) Dumb me!
Praise
Hi Pep,
Pep Serrano
Except... those messages where the pros do blame someone's mistakes or just a message out of topic.
I'll reply to later first. This is a high volume mailing list, so there have to be rules that help to reduce the 'noise' and one of them is keeping mail on topic. It's the sum of all those 'just a message out of topic' that will soon annoy people. And please show me where pros blame mistakes. I at least won't blame somebody for errors he's done, but I will blame him if he/she didn't heed the advice given or if he neglected to get the information (support database, manuals, howtos, man pages etc.) before coming to the list.
Do you think this is the way to promote our OS to be user friendly? Are you user friendly at all???
Of course being rude doesn't suit this list, but that's very seldom the case. Philipp
participants (4)
-
Dunphy Richard-rdunph01
-
Pep Serrano
-
Philipp Thomas
-
Praise