X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Martin Ambuhl Newsgroups: comp.os.msdos.djgpp Subject: Re: assert statement is not accepted in C++ Date: Mon, 07 Feb 2005 10:49:54 -0500 Lines: 29 Message-ID: <36ph1cF53ug72U1@individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 2kf17zPsjRkMpjksiCnC1Q5f9jWKdR1Wt1Nv6eyGy7dxfY473H User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Mok-Kong Shen wrote: > > The following code works o.k. (in DJGPP Version 2.03) with > file name prog.c but doesn't compile with file name prog.cc. > (Error message 'undefined reference to .....', which vanishes > when the assert statement is commented out.) > > #include > #include > int main() > { int i=1; > assert(i>0); > printf("i = %d\n",i); > return 0; > } I strongly suspect that you are not linking the C++ library files. Are you perhaps trying to use gcc $FLAGS a.cc instead of gpp $FLAGS a.cc ? -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson