Message-ID: <37484FDF.6F185581@enter.net> Date: Sun, 23 May 1999 14:58:39 -0400 From: Sean X-Mailer: Mozilla 4.51 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp,comp.lang.c++ Subject: Re: Problems using CYGWIN References: <373FBB9C DOT FE26B278 AT netvigator DOT com> <37422F98 DOT D16AE5AA AT netvigator DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 207.16.153.49 X-Original-NNTP-Posting-Host: 207.16.153.49 X-Trace: 23 May 1999 14:58:08 -0400, 207.16.153.49 Organization: Enter.Net Lines: 36 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com NG Chi Fai wrote: > > Hello, > > I've tried to add a copy constructor, but still got the same error: > > [main] C:\WINDOWS\DESKTOP\A.EXE 1010 (0) handle_exceptions: Exception: > STATUS_ACCESS_VIOLATION > [main] A 1010 (0) handle_exceptions: Dumping stack trace to A.EXE.core > > Besides, compiler report as below, but I have no idea what is going on, > besides, it seems to warn for the 1st instantiation of a::~a only, > it does not warn on a::~a. But when I inverse order of > declaration of a and a it warn on a. What is it all > about. > > test.cpp: In instantiation of `a::~a()': > test.cpp:65: instantiated from here > test.cpp:65: warning: template `a::~a()' instantiated in file > without #pragma interface > > // copy constructor > template < class U > a(const a &v) > { > t=new T[256]; > int i; > for(i=0;i<256;i++) > { > t[i]=T(v.t[i]); > } > }; Don't you need the first line of the copy constructor to be template a::a(const a &v) ? I don't really know much about c++, but I know you need something, maybe a instead of a, though maybe you just typed it wrong here.