delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/02/07/09:46:13

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Mok-Kong Shen <mok-kong DOT shen AT t-online DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: assert statement is not accepted in C++
Date: Mon, 07 Feb 2005 15:30:35 +0100
Organization: T-Online
Lines: 17
Message-ID: <cu7tua$ri$00$1@news.t-online.com>
Mime-Version: 1.0
X-Trace: news.t-online.com 1107786506 00 882 M+ilr8wOI9PO18j 050207 14:28:26
X-Complaints-To: usenet-abuse AT t-online DOT de
X-ID: GziwcOZFgeZisUA-9q+6gU3tLggIvOpKxQkdK1yFYSuUk8zRBsw+gh
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 <stdio.h>
#include <assert.h>
int main()
{ int i=1;
   assert(i>0);
   printf("i = %d\n",i);
   return 0;
}

M. K. Shen

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019