www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/16/10:54:00

Date: Thu, 16 Feb 1995 15:57:05 +0100
From: haridas AT math DOT ethz DOT ch
Apparently-To: djgpp AT sun DOT soe DOT clarkson DOT edu

Dear Programmers,
 Again I would like to ask you for advice.
It is the same story.
I have installed gcc and the gnu c++  , called cc1plus.exe with the environment
on my box at home.
I do need to compile a big geometry packet (with graphics) with runs without
problems on the Sparcs with Solaris 2.4 and the DEC Alpha.
So the code must be alright.
If I compile the very little source enclosed below on my 486 bin, then I 
get the cumbersome message below.

Who can help
I do not knwo much about the 486 due to lack of interest.
Normally I work in Quantum Field Theory and do not bother about registers and 
segments.........

    Olivar Maoba,  Fed. Inst. of Technology,  Inst.of High Energy Physics.

thanks






// square.cpp
// yes
#include <iostream.h>

long int sum(long int n)
{
   long int i,result=0;
   for (i=1;i<=n;++i)
     result +=i*i*i;
   return result;
}
main()
{	   
	for (int i=0; i < 500;++i)
	  cout << "The sum of the first " << i << "cubes is " <<sum(i) << "\n";
	return 0;
}




D:\SRC\CAPPER\FIVE>cc1plus cube.cc
cube.cc:1: parse error before `/'
cube.cc:3: undefined or invalid # directive
 int main()General Protection Fault at eip=112ac
eax=00000000 ebx=00000000 ecx=0000014c edx=00162af0 esi=001b1d80 edi=0080b951
ebp=001ac6f0 esp=001ac62c cs=af ds=a7 es=a7 fs=a7 gs=a7 ss=b7 cr2=0000cfe4
Call frame traceback EIPs:
  0x000112ac
  0x0000b0a6
  0x00049ccc
  0x00071ddb
  0x000768f2


- Raw text -


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