From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,b3aaec6ec3fb9746,start X-Google-Attributes: gid1164f8,public From: Tom Bech Subject: HELP! Why doesn't cxx compile this, when all others do? Date: 1996/04/30 Message-ID: <31863926.41C6@ii.uib.no>#1/1 X-Deja-AN: 152265266 content-type: text/plain; charset=us-ascii organization: University of Bergen mime-version: 1.0 newsgroups: comp.sys.dec x-mailer: Mozilla 3.0b2 (X11; I; IRIX 5.3 IP17) Hi, I've tried compiling the very simple program "test.C" (see source listing below) resulting in this: > uname -a OSF1 svartbak V3.0 347 alpha > cxx -c -O -I. test.C > cxx -o test test.o ld: Unresolved: __dt__19listnode__T7intnodeXv __ct__15list__T7intnodeXv __dt__15list__T7intnodeXv > The cxx compiler is the only one I've run into that doesn't want to compile/link this. It works fine with gcc(c++) 2.7.2 and also with SGI's Delta c++ compiler running IRIX 5.3. I've also tried it on Solaris and SunOS. Can any of you DEC people explain what happens? Using gcc 2.7.2: > uname -a OSF1 svartbak V3.0 347 alpha > c++ -c -O -I. test.C > c++ -o test test.o > test This program does nothing; cxx won't have it > And on a SGI: > uname -a IRIX gullregn 5.3 11091810 IP17 mips > CC -c -O -I. test.C > CC -o test test.o C++ prelinker: executing: /usr/bin/NCC -c -O -I. test.C -o32 > test This program does nothing; cxx won't have it > Thanks in advance Tom ps: The program is just an general example of the problem --------------------------------- Msc. Section. Dep. of Informatics Univ. of Bergen, Norway --------------------------------- ------------------------- Test.C -------------------------- #include #include #include "IntList.H" void main(void) { intlist *list= new intlist; cout << "This program does nothing; cxx won't have it\n"; delete list; } ------------------------- IntList.H ------------------------- #ifndef INTLISTH #define INTLISTH #include "MyList.H" class intnode : public listnode { protected: int i; public: int Get_i(void) { return(i); } }; class intlist : public list { protected: // Empty public: // Empty }; #endif --------------------------- MyList.H ------------------------------ #ifndef MYLISTH #define MYLISTH template class listnode { protected: long int index; nodetype *next; nodetype *prev; public: listnode(); virtual ~listnode(); nodetype *Next(void) { return(next); } nodetype *Prev(void) { return(prev); } }; template class list { protected: nodetype *head; // head of list nodetype *tail; // tail of list nodetype *current; // current element long int num; // number of elements in list public: list(); virtual ~list(); }; template listnode::~listnode(void) { // Empty } template listnode::listnode(void) { next=NULL; prev=NULL; index=0; } template list::list(void) { num=0; head=NULL; tail=NULL; current=NULL; } template list::~list(void) { // Empty } #endif ----------------------------- EOF ----------------------------------