[net.lang.c++] complex arithmetic problem

merworth@ut-ngp.UUCP (Boyd Merworth) (07/09/86)

I have been building the C++ Translator, Release 1.0 and have
a question.

I followed the tips from Jonathan P. Leech in his posting to
this newsgroup <278@cit-vax.Caltech.Edu>, dated 24 March 1986.
I was able to build a cfront successfully and even tested munch
with the "Hello, world" program.  But I have tried an example
program from the Release Notes and am unsuccessful in getting it
to compile.  The program is:


	#include <complex.h>
	
	main(){
		complex xx;
		complex yy = complex(1,2.718);
		xx = log (yy/3);
		cout << 1+xx;
	}

When I compile it with CC, I get the following errors:

	CC  test.c:
	cc   test..c -lC
	Undefined:
	_log
	_atan2

Any help will be greatly appreciated.  I am building the translator
on a VAX 11/780 running 4.2BSD.
-- 
Boyd Merworth
The University of Texas at Austin, Computation Center,   Austin, TX 78712
merworth@ngp.cc.utexas.edu 	 {ihnp4,allegra,ut-sally}!ut-ngp!merworth
				 	       {seismo}!ut-sally!merworth

ark@alice.UucP (Andrew Koenig) (07/10/86)

> When I compile it with CC, I get the following errors:
>
>	CC  test.c:
>	cc   test..c -lC
>	Undefined:
>	_log
>	_atan2

Try saying

	CC test.c -lm