🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by merworth Fri, 11 Jul 1986 16:20
complex artihmetic again
#250
Author: merworth
Date: Fri, 11 Jul 1986 16:20
35 lines
1664 bytes
First, thanks to everyone who responded to my posting about
the complex arithmetic problem.  I added the -lm flag to include
the math library.  Now I have a new set of problems with the
same program.  At first I thought it was due to the fact that
the CC script allowed a command line of the form (which it should):

	CC test.c -lC -lm

but when passed to cc, the -lC flag was added again.

	cc   test..c -lC -lm -lC

But I modified the CC script to not include any libraries as default.
Either way, I get the same error messages.

My command line: CC test.c -lC -lm

	CC  test.c:
	cc   test..c -lC -lm 
	__ctors: ld:__ctdt.o: multiply defined
	__dtors: __ctdt.o: multiply defined

Please excuse me if I am just overlooking something obvious.  If I take
the test.o file and load it manually, I get an executable file but it
gives a "Bus error core dump" when executed. 

	ld -X /lib/crt0.o test.o -lC -lm -lc

Thanks for any help.
-- 
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
Re: complex artihmetic again
#253
Author: kana
Date: Tue, 15 Jul 1986 14:28
35 lines
1398 bytes
> My command line: CC test.c -lC -lm
> 
> 	CC  test.c:
> 	cc   test..c -lC -lm 
> 	__ctors: ld:__ctdt.o: multiply defined
> 	__dtors: __ctdt.o: multiply defined

I found that CC executes the following commands:

/lib/cpp -C -I/usr/include/CC test.c | cfront +L +ftest.c > test..c
cc -c test..c -lC -lm
mv test..o test.o
cc test.o -lC -lm -lC
nm a.out | munch > __ctdt.c
cc -c __ctdt.c
cc test.o -lC -lm __ctdt.o -lC

If the last line is
	cc test.o __ctdt.o -lC -lm -lC
we can get a correct executable a.out.

I am using the following command, because I don't dare to rewrite CC.

From sh:
	LIBRARY="-lC -lm" CC test.c

From csh:
	setenv LIBRARY "-lC -lm"
	CC test.c
-- 
Katsumi Kanasaki
Software Research Center, Ricoh Co., Ltd.
PHONE: (03)815-7261
JUNET: kana@charlie.ricoh.junet
UUCP: ...!{hplabs,mcvax}!kddlab!titcca!koccvax!kossvax!patty!charlie!kana
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads