[comp.lang.c++] Novice question

ih05+@andrew.cmu.edu (Ingemar Hulthage) (03/23/91)

	 I am trying to use the g++ compiler. I have obtained a test
	 file from the 1.36 release.  However, I can't get it to
	 compile. I beleive that I have to include some library or
	 change my search path somehow, but I can't figure out how. I
	 have tried the -lm switch and it eliminates sqrt from the list
	 of undefined symbols. What library or other file do I need ?
	I append a script below.
	 

% g++ libg++/tests/tRandom.cc
tRandom.o: Undefined symbol _sqrt referenced from text segment
tRandom.o: Undefined symbol _sqrt referenced from text segment
tRandom.o: Undefined symbol _sqrt referenced from text segment
tRandom.o: Undefined symbol _sqrt referenced from text segment
tRandom.o: Undefined symbol _log referenced from text segment
tRandom.o: Undefined symbol _sqrt referenced from text segment
tRandom.o: Undefined symbol _log referenced from text segment
../g++-include/RNG.h:82: Undefined symbol _log referenced from text segment
../g++-include/RNG.h:82: Undefined symbol _log referenced from text segment
Random.cc:90: Undefined symbol _log referenced from text segment
Random.cc:90: Undefined symbol _sqrt referenced from text segment
Random.cc:106: Undefined symbol _exp referenced from text segment
../g++-include/RNG.h:82: Undefined symbol _floor referenced from text segment
../g++-include/RNG.h:82: Undefined symbol _log referenced from text segment
../g++-include/RNG.h:82: Undefined symbol _pow referenced from text segment
Random.cc:154: Undefined symbol _log referenced from text segment
Random.cc:166: Undefined symbol _pow referenced from text segment
Sample.cc:62: Undefined symbol _tan referenced from text segment
Sample.cc:64: Undefined symbol _sqrt referenced from text segment
Sample.cc:68: Undefined symbol _log referenced from text segment
Sample.cc:68: Undefined symbol _sqrt referenced from text segment
Sample.cc:74: Undefined symbol _exp referenced from text segment
Sample.cc:125: Undefined symbol _sqrt referenced from text segment
Sample.cc:0: More undefined symbol _sqrt refs follow
% 

Ingemar Hulthage

Scientist, PhD
Carnegie Mellon Research Institute
Phone: (412) 268-6376

Home:
306 S. Linden Avenue
Pittsburgh, PA 15208
Phone: (412) 441-3560